diff options
author | Michael Niedermayer <michael@niedermayer.cc> | 2016-08-27 01:12:49 +0200 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2016-09-27 13:42:11 +0200 |
commit | ba642f031906b89566c60426cd2c0ffcd43072ea (patch) | |
tree | 5fbdf4c40fb5e738996cf0d520b6b76893a2233b | |
parent | 8b21b44e7e312589a6c4dbad1b4214f2a03fb54a (diff) | |
download | ffmpeg-ba642f031906b89566c60426cd2c0ffcd43072ea.tar.gz |
avformat/utils: End probing if the expected codec surpasses AVPROBE_SCORE_STREAM_RETRY
Fixes Ticket5800
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit c75273310cf1becffee79bab0e2bba0b1606afb7)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r-- | libavformat/utils.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/libavformat/utils.c b/libavformat/utils.c index f470c79079..1711bef6ac 100644 --- a/libavformat/utils.c +++ b/libavformat/utils.c @@ -307,7 +307,7 @@ static int set_codec_from_probe_data(AVFormatContext *s, AVStream *st, int score; AVInputFormat *fmt = av_probe_input_format3(pd, 1, &score); - if (fmt && st->request_probe <= score) { + if (fmt) { int i; av_log(s, AV_LOG_DEBUG, "Probe with size=%d, packets=%d detected %s with score=%d\n", @@ -318,6 +318,9 @@ static int set_codec_from_probe_data(AVFormatContext *s, AVStream *st, if (fmt_id_type[i].type != AVMEDIA_TYPE_AUDIO && st->codecpar->sample_rate) continue; + if (st->request_probe > score && + st->codecpar->codec_id != fmt_id_type[i].id) + continue; st->codecpar->codec_id = fmt_id_type[i].id; st->codecpar->codec_type = fmt_id_type[i].type; st->internal->need_context_update = 1; |