Browse Source

avformat: replace "AVPROBE_SCORE_MAX / X" by AVPROBE_SCORE_EXTENSION / Y

Demuxers where the changed code looked less readable where skiped

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
tags/n2.0
Michael Niedermayer 12 years ago
parent
commit
097f668047
15 changed files with 18 additions and 18 deletions
  1. +1
    -1
      libavformat/aqtitledec.c
  2. +1
    -1
      libavformat/avr.c
  3. +1
    -1
      libavformat/bit.c
  4. +1
    -1
      libavformat/boadec.c
  5. +1
    -1
      libavformat/cdxl.c
  6. +1
    -1
      libavformat/jacosubdec.c
  7. +1
    -1
      libavformat/libquvi.c
  8. +3
    -3
      libavformat/loasdec.c
  9. +1
    -1
      libavformat/lvfdec.c
  10. +1
    -1
      libavformat/mpsubdec.c
  11. +1
    -1
      libavformat/realtextdec.c
  12. +1
    -1
      libavformat/subviewer1dec.c
  13. +1
    -1
      libavformat/subviewerdec.c
  14. +1
    -1
      libavformat/tedcaptionsdec.c
  15. +2
    -2
      libavformat/wavdec.c

+ 1
- 1
libavformat/aqtitledec.c View File

@@ -43,7 +43,7 @@ static int aqt_probe(AVProbeData *p)
const char *ptr = p->buf;

if (sscanf(ptr, "-->> %d", &frame) == 1)
return AVPROBE_SCORE_MAX / 2;
return AVPROBE_SCORE_EXTENSION;
return 0;
}



+ 1
- 1
libavformat/avr.c View File

@@ -27,7 +27,7 @@
static int avr_probe(AVProbeData *p)
{
if (AV_RL32(p->buf) == MKTAG('2', 'B', 'I', 'T'))
return AVPROBE_SCORE_MAX / 2;
return AVPROBE_SCORE_EXTENSION;
return 0;
}



+ 1
- 1
libavformat/bit.c View File

@@ -44,7 +44,7 @@ static int probe(AVProbeData *p)
return 0;
i+=j;
}
return AVPROBE_SCORE_MAX/2;
return AVPROBE_SCORE_EXTENSION;
}

static int read_header(AVFormatContext *s)


+ 1
- 1
libavformat/boadec.c View File

@@ -35,7 +35,7 @@ static int probe(AVProbeData *p)
|| AV_RL32(p->buf + 48) % AV_RL32(p->buf + 21)
)
return 0;
return AVPROBE_SCORE_MAX / 2;
return AVPROBE_SCORE_EXTENSION;
}




+ 1
- 1
libavformat/cdxl.c View File

@@ -41,7 +41,7 @@ typedef struct CDXLDemuxContext {

static int cdxl_read_probe(AVProbeData *p)
{
int score = AVPROBE_SCORE_MAX / 2 + 10;
int score = AVPROBE_SCORE_EXTENSION + 10;

if (p->buf_size < CDXL_HEADER_SIZE)
return 0;


+ 1
- 1
libavformat/jacosubdec.c View File

@@ -60,7 +60,7 @@ static int jacosub_probe(AVProbeData *p)
ptr++;
if (*ptr != '#' && *ptr != '\n') {
if (timed_line(ptr))
return AVPROBE_SCORE_MAX/2 + 1;
return AVPROBE_SCORE_EXTENSION + 1;
return 0;
}
ptr += strcspn(ptr, "\n") + 1;


+ 1
- 1
libavformat/libquvi.c View File

@@ -127,7 +127,7 @@ static int libquvi_probe(AVProbeData *p)
rc = quvi_init(&q);
if (rc != QUVI_OK)
return AVERROR(ENOMEM);
score = quvi_supported(q, (char *)p->filename) == QUVI_OK ? AVPROBE_SCORE_MAX/2 : 0;
score = quvi_supported(q, (char *)p->filename) == QUVI_OK ? AVPROBE_SCORE_EXTENSION : 0;
quvi_close(&q);
return score;
}


+ 3
- 3
libavformat/loasdec.c View File

@@ -52,9 +52,9 @@ static int loas_probe(AVProbeData *p)
if(buf == buf0)
first_frames= frames;
}
if (first_frames>=3) return AVPROBE_SCORE_MAX/2+1;
else if(max_frames>100)return AVPROBE_SCORE_MAX/2;
else if(max_frames>=3) return AVPROBE_SCORE_MAX/4;
if (first_frames>=3) return AVPROBE_SCORE_EXTENSION+1;
else if(max_frames>100)return AVPROBE_SCORE_EXTENSION;
else if(max_frames>=3) return AVPROBE_SCORE_EXTENSION / 2;
else return 0;
}



+ 1
- 1
libavformat/lvfdec.c View File

@@ -26,7 +26,7 @@
static int lvf_probe(AVProbeData *p)
{
if (AV_RL32(p->buf) == MKTAG('L', 'V', 'F', 'F'))
return AVPROBE_SCORE_MAX / 2;
return AVPROBE_SCORE_EXTENSION;
return 0;
}



+ 1
- 1
libavformat/mpsubdec.c View File

@@ -41,7 +41,7 @@ static int mpsub_probe(AVProbeData *p)

if (!memcmp(ptr, "FORMAT=TIME", 11) ||
sscanf(ptr, "FORMAT=%d", &n) == 1)
return AVPROBE_SCORE_MAX/2;
return AVPROBE_SCORE_EXTENSION;
ptr += strcspn(ptr, "\n") + 1;
}
return 0;


+ 1
- 1
libavformat/realtextdec.c View File

@@ -41,7 +41,7 @@ static int realtext_probe(AVProbeData *p)

if (AV_RB24(ptr) == 0xEFBBBF)
ptr += 3; /* skip UTF-8 BOM */
return !av_strncasecmp(ptr, "<window", 7) ? AVPROBE_SCORE_MAX/2 : 0;
return !av_strncasecmp(ptr, "<window", 7) ? AVPROBE_SCORE_EXTENSION : 0;
}

static int read_ts(const char *s)


+ 1
- 1
libavformat/subviewer1dec.c View File

@@ -36,7 +36,7 @@ static int subviewer1_probe(AVProbeData *p)
const unsigned char *ptr = p->buf;

if (strstr(ptr, "******** START SCRIPT ********"))
return AVPROBE_SCORE_MAX / 2;
return AVPROBE_SCORE_EXTENSION;
return 0;
}



+ 1
- 1
libavformat/subviewerdec.c View File

@@ -44,7 +44,7 @@ static int subviewer_probe(AVProbeData *p)
if (AV_RB24(ptr) == 0xEFBBBF)
ptr += 3; /* skip UTF-8 BOM */
if (sscanf(ptr, "%*u:%*u:%*u.%*u,%*u:%*u:%*u.%*u%c", &c) == 1)
return AVPROBE_SCORE_MAX/2;
return AVPROBE_SCORE_EXTENSION;
if (!strncmp(ptr, "[INFORMATION]", 13))
return AVPROBE_SCORE_MAX/3;
return 0;


+ 1
- 1
libavformat/tedcaptionsdec.c View File

@@ -340,7 +340,7 @@ static av_cold int tedcaptions_read_probe(AVProbeData *p)
count++;
}
return count == FF_ARRAY_ELEMS(tags) ? AVPROBE_SCORE_MAX :
count ? AVPROBE_SCORE_MAX / 2 : 0;
count ? AVPROBE_SCORE_EXTENSION : 0;
}

static int tedcaptions_read_seek(AVFormatContext *avf, int stream_index,


+ 2
- 2
libavformat/wavdec.c View File

@@ -99,7 +99,7 @@ static int wav_probe(AVProbeData *p)
static void handle_stream_probing(AVStream *st)
{
if (st->codec->codec_id == AV_CODEC_ID_PCM_S16LE) {
st->request_probe = AVPROBE_SCORE_MAX/2;
st->request_probe = AVPROBE_SCORE_EXTENSION;
st->probe_packets = FFMIN(st->probe_packets, 4);
}
}
@@ -427,7 +427,7 @@ static int wav_read_packet(AVFormatContext *s, AVPacket *pkt)
enum AVCodecID codec;
ret = ff_spdif_probe(s->pb->buffer, s->pb->buf_end - s->pb->buffer,
&codec);
if (ret > AVPROBE_SCORE_MAX / 2) {
if (ret > AVPROBE_SCORE_EXTENSION) {
s->streams[0]->codec->codec_id = codec;
wav->spdif = 1;
} else {


Loading…
Cancel
Save