[FFmpeg-cvslog] lavf: allow av_find_best_stream to return AV_DISPOSITION_*_IMPAIRED wanted_streams

Marton Balint git at videolan.org
Mon Feb 10 13:03:26 CET 2014


ffmpeg | branch: master | Marton Balint <cus at passwd.hu> | Tue Feb  4 23:59:47 2014 +0100| [6421111b52de4442768e7ef31b4d29055f83900c] | committer: Michael Niedermayer

lavf: allow av_find_best_stream to return AV_DISPOSITION_*_IMPAIRED wanted_streams

Previously these type of streams were not returned even if wanted stream was
set to a stream of such. Now they are only skipped if they are not wanted
streams.

Fixes ffplay -sst <stream number> out.ts where stream number is a *_IMPAIRED stream.

Signed-off-by: Marton Balint <cus at passwd.hu>
Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=6421111b52de4442768e7ef31b4d29055f83900c
---

 libavformat/utils.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/libavformat/utils.c b/libavformat/utils.c
index 2be4279..5cb7561 100644
--- a/libavformat/utils.c
+++ b/libavformat/utils.c
@@ -3373,7 +3373,8 @@ int av_find_best_stream(AVFormatContext *ic, enum AVMediaType type,
             continue;
         if (wanted_stream_nb >= 0 && real_stream_index != wanted_stream_nb)
             continue;
-        if (st->disposition & (AV_DISPOSITION_HEARING_IMPAIRED |
+        if (wanted_stream_nb != real_stream_index &&
+            st->disposition & (AV_DISPOSITION_HEARING_IMPAIRED |
                                AV_DISPOSITION_VISUAL_IMPAIRED))
             continue;
         if (type == AVMEDIA_TYPE_AUDIO && !avctx->channels)



More information about the ffmpeg-cvslog mailing list