Browse Source

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>
tags/n0.8
Balint Marton Mans Rullgard 14 years ago
parent
commit
22ec6b738f
1 changed files with 1 additions and 1 deletions
  1. +1
    -1
      libavformat/utils.c

+ 1
- 1
libavformat/utils.c 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;


Loading…
Cancel
Save