From fa14610df5e21fd562922a5622daf42f746df978 Mon Sep 17 00:00:00 2001 From: Marton Balint Date: Sun, 20 Feb 2011 01:18:49 +0100 Subject: [PATCH] Fix av_find_best_stream when decoder_ret is given and using a related stream Yet another fix for the code originally designed for use without related_stream. Signed-off-by: Michael Niedermayer --- libavformat/utils.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavformat/utils.c b/libavformat/utils.c index c38c9ca729..b5e052fe6e 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;