Skip to content

Commit

Permalink
avformat: use AVPROBE_SCORE_STREAM_RETRY, instead of AVPROBE_SCORE_RE…
Browse files Browse the repository at this point in the history
…TRY - 1

This makes the code clearer

Signed-off-by: Michael Niedermayer <[email protected]>
  • Loading branch information
michaelni committed Feb 2, 2014
1 parent 9f6f496 commit 1bc2fa4
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
2 changes: 2 additions & 0 deletions libavformat/avformat.h
Original file line number Diff line number Diff line change
Expand Up @@ -338,6 +338,8 @@ typedef struct AVProbeData {
} AVProbeData;

#define AVPROBE_SCORE_RETRY (AVPROBE_SCORE_MAX/4)
#define AVPROBE_SCORE_STREAM_RETRY (AVPROBE_SCORE_MAX/4-1)

#define AVPROBE_SCORE_EXTENSION 50 ///< score for file extension
#define AVPROBE_SCORE_MAX 100 ///< maximum score

Expand Down
2 changes: 1 addition & 1 deletion libavformat/utils.c
Original file line number Diff line number Diff line change
Expand Up @@ -659,7 +659,7 @@ static int probe_codec(AVFormatContext *s, AVStream *st, const AVPacket *pkt)

if (end || av_log2(pd->buf_size) != av_log2(pd->buf_size - pkt->size)) {
int score = set_codec_from_probe_data(s, st, pd);
if ( (st->codec->codec_id != AV_CODEC_ID_NONE && score > AVPROBE_SCORE_RETRY-1)
if ( (st->codec->codec_id != AV_CODEC_ID_NONE && score > AVPROBE_SCORE_STREAM_RETRY)
|| end) {
pd->buf_size = 0;
av_freep(&pd->buf);
Expand Down
2 changes: 1 addition & 1 deletion libavformat/version.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@

#define LIBAVFORMAT_VERSION_MAJOR 55
#define LIBAVFORMAT_VERSION_MINOR 29
#define LIBAVFORMAT_VERSION_MICRO 100
#define LIBAVFORMAT_VERSION_MICRO 101

#define LIBAVFORMAT_VERSION_INT AV_VERSION_INT(LIBAVFORMAT_VERSION_MAJOR, \
LIBAVFORMAT_VERSION_MINOR, \
Expand Down

0 comments on commit 1bc2fa4

Please sign in to comment.