[FFmpeg-devel] [PATCH] Fix av_find_best_stream when decoder_ret is given and using a related stream

Marton Balint cus
Sun Feb 20 01:18:49 CET 2011


Yet another fix for the code originally designed for use without related_stream.
---
 libavformat/utils.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/libavformat/utils.c b/libavformat/utils.c
index adb7e46..2f4fd24 100644
--- a/libavformat/utils.c
+++ b/libavformat/utils.c
@@ -2520,7 +2520,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;
-- 
1.7.1




More information about the ffmpeg-devel mailing list