lavf: dont open a decoder at the top of find_stream_info before probing has finished
authorMichael Niedermayer <michaelni@gmx.at>
Sun, 23 Sep 2012 02:49:59 +0000 (04:49 +0200)
committerMichael Niedermayer <michaelni@gmx.at>
Sun, 23 Sep 2012 02:56:21 +0000 (04:56 +0200)
It could open the wrong decoder.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavformat/utils.c

index 0a79fe7..0732c46 100644 (file)
@@ -2557,7 +2557,7 @@ int avformat_find_stream_info(AVFormatContext *ic, AVDictionary **options)
                               : &thread_opt);
 
         //try to just open decoders, in case this is enough to get parameters
-        if (!has_codec_parameters(st, NULL)) {
+        if (!has_codec_parameters(st, NULL) && st->request_probe <= 0) {
             if (codec && !st->codec->codec)
                 avcodec_open2(st->codec, codec, options ? &options[i]
                               : &thread_opt);