Module: ffmpeg
Branch: master
Commit: 22ec6b738f1608e4b959fb655cf37c3343ec7e9f

Author: Balint Marton <[email protected]>
Date:   Wed Feb 16 00:17:13 2011 +0000

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 <[email protected]>

---

 libavformat/utils.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/libavformat/utils.c b/libavformat/utils.c
index 225b9f2..be4d6f7 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;

_______________________________________________
ffmpeg-commits mailing list
[email protected]
https://lists.mplayerhq.hu/mailman/listinfo/ffmpeg-commits

Reply via email to