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 22ec6b738f1608e4b959fb655cf37c3343ec7e9f)
This commit is contained in:
parent
20bc55ce5c
commit
33af787d8a
@ -2529,7 +2529,7 @@ int av_find_best_stream(AVFormatContext *ic,
|
|||||||
if (best_count >= st->codec_info_nb_frames)
|
if (best_count >= st->codec_info_nb_frames)
|
||||||
continue;
|
continue;
|
||||||
best_count = st->codec_info_nb_frames;
|
best_count = st->codec_info_nb_frames;
|
||||||
ret = i;
|
ret = program ? program[i] : i;
|
||||||
best_decoder = decoder;
|
best_decoder = decoder;
|
||||||
if (program && i == nb_streams - 1 && ret < 0) {
|
if (program && i == nb_streams - 1 && ret < 0) {
|
||||||
program = NULL;
|
program = NULL;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user