Skip to content

Commit

Permalink
avformat: replace "AVPROBE_SCORE_MAX / X" by AVPROBE_SCORE_EXTENSION / Y
Browse files Browse the repository at this point in the history
Demuxers where the changed code looked less readable where skiped

Signed-off-by: Michael Niedermayer <[email protected]>
  • Loading branch information
michaelni committed May 5, 2013
1 parent a1f234b commit 097f668
Show file tree
Hide file tree
Showing 15 changed files with 18 additions and 18 deletions.
2 changes: 1 addition & 1 deletion libavformat/aqtitledec.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down
2 changes: 1 addition & 1 deletion libavformat/avr.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down
2 changes: 1 addition & 1 deletion libavformat/bit.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion libavformat/boadec.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}


Expand Down
2 changes: 1 addition & 1 deletion libavformat/cdxl.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion libavformat/jacosubdec.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion libavformat/libquvi.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
6 changes: 3 additions & 3 deletions libavformat/loasdec.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down
2 changes: 1 addition & 1 deletion libavformat/lvfdec.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down
2 changes: 1 addition & 1 deletion libavformat/mpsubdec.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion libavformat/realtextdec.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion libavformat/subviewer1dec.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down
2 changes: 1 addition & 1 deletion libavformat/subviewerdec.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion libavformat/tedcaptionsdec.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
4 changes: 2 additions & 2 deletions libavformat/wavdec.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
Expand Down Expand Up @@ -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 {
Expand Down

0 comments on commit 097f668

Please sign in to comment.