1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2025-01-08 13:22:53 +02:00

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>
(cherry picked from commit 22ec6b738f)
This commit is contained in:
Balint Marton 2011-02-16 00:17:13 +00:00 committed by Michael Niedermayer
parent 20bc55ce5c
commit 33af787d8a

View File

@ -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;