From 1bc2fa447c22df09d312a7fba7e95531cfb051f8 Mon Sep 17 00:00:00 2001 From: Michael Niedermayer Date: Sun, 2 Feb 2014 23:48:37 +0100 Subject: [PATCH] avformat: use AVPROBE_SCORE_STREAM_RETRY, instead of AVPROBE_SCORE_RETRY - 1 This makes the code clearer Signed-off-by: Michael Niedermayer --- libavformat/avformat.h | 2 ++ libavformat/utils.c | 2 +- libavformat/version.h | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/libavformat/avformat.h b/libavformat/avformat.h index 50b710816bb95..13f6524d85cfb 100644 --- a/libavformat/avformat.h +++ b/libavformat/avformat.h @@ -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 diff --git a/libavformat/utils.c b/libavformat/utils.c index c094eec6744ed..c2705ac4ff5cc 100644 --- a/libavformat/utils.c +++ b/libavformat/utils.c @@ -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); diff --git a/libavformat/version.h b/libavformat/version.h index 38945a57fd4ce..7a9aa4d4c7fd8 100644 --- a/libavformat/version.h +++ b/libavformat/version.h @@ -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, \