diff options
author | Balint Marton <cus@passwd.hu> | 2011-02-16 00:17:13 +0000 |
---|---|---|
committer | Mans Rullgard <mans@mansr.com> | 2011-02-16 11:47:42 +0000 |
commit | 22ec6b738f1608e4b959fb655cf37c3343ec7e9f (patch) | |
tree | 5fdf6396aa83300a5d5a7af71f6219d555ce0af0 /libavformat/utils.c | |
parent | 938b62538a719785bce0f1d49d3065937b29e3aa (diff) | |
download | ffmpeg-22ec6b738f1608e4b959fb655cf37c3343ec7e9f.tar.gz |
Fix av_find_best_stream when using a program
The current implementation has a bug, it is returning the stream index
in the found program, and not the stream index in the list of all
streams. The attached patch fixes this issue.
Signed-off-by: Mans Rullgard <mans@mansr.com>
Diffstat (limited to 'libavformat/utils.c')
-rw-r--r-- | libavformat/utils.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/libavformat/utils.c b/libavformat/utils.c index 225b9f22da..be4d6f78af 100644 --- a/libavformat/utils.c +++ b/libavformat/utils.c @@ -2529,7 +2529,7 @@ int av_find_best_stream(AVFormatContext *ic, if (best_count >= st->codec_info_nb_frames) continue; best_count = st->codec_info_nb_frames; - ret = i; + ret = program ? program[i] : i; best_decoder = decoder; if (program && i == nb_streams - 1 && ret < 0) { program = NULL; |