lavf: fix av_find_best_stream when decoder_ret is given and using a related stream.
authorMarton Balint <cus@passwd.hu>
Sun, 20 Feb 2011 00:18:49 +0000 (01:18 +0100)
committerAnton Khirnov <anton@khirnov.net>
Thu, 12 May 2011 16:02:27 +0000 (18:02 +0200)
Yet another fix for the code originally designed for use without related_stream.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Signed-off-by: Anton Khirnov <anton@khirnov.net>
libavformat/utils.c

index 7959102e0a0a396bf6768f279ea5b7895fd8d3d0..830e5d03c2d22acf7d43f3b89d6f61ba5ad6b71e 100644 (file)
@@ -2484,7 +2484,7 @@ int av_find_best_stream(AVFormatContext *ic,
         if (st->disposition & (AV_DISPOSITION_HEARING_IMPAIRED|AV_DISPOSITION_VISUAL_IMPAIRED))
             continue;
         if (decoder_ret) {
-            decoder = avcodec_find_decoder(ic->streams[i]->codec->codec_id);
+            decoder = avcodec_find_decoder(st->codec->codec_id);
             if (!decoder) {
                 if (ret < 0)
                     ret = AVERROR_DECODER_NOT_FOUND;