]> rtime.felk.cvut.cz Git - frescor/ffmpeg.git/commitdiff
Apply the same logic used for subtitle stream selection to audio and video
authorstefano <stefano@9553f0bf-9b14-0410-a0b8-cfaf0461ba5b>
Sun, 1 Mar 2009 17:06:01 +0000 (17:06 +0000)
committerstefano <stefano@9553f0bf-9b14-0410-a0b8-cfaf0461ba5b>
Sun, 1 Mar 2009 17:06:01 +0000 (17:06 +0000)
stream selection.

Make the counting starts from 0, and disable the corresponding playbck
when the selected stream number is negative.

See the thread:
" [FFmpeg-devel] [PATCH] Add documentation for -ast, -vst, -sst".

git-svn-id: file:///var/local/repositories/ffmpeg/trunk@17693 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b

ffplay.c

index b4927c674472f0bd862e99f9d8a74f10c741fdc8..c70f530ea1944bcf6460caa9456a62fc23b56cef 100644 (file)
--- a/ffplay.c
+++ b/ffplay.c
@@ -1974,11 +1974,11 @@ static int decode_thread(void *arg)
         ic->streams[i]->discard = AVDISCARD_ALL;
         switch(enc->codec_type) {
         case CODEC_TYPE_AUDIO:
-            if ((audio_index < 0 || wanted_audio_stream-- > 0) && !audio_disable)
+            if (wanted_audio_stream-- >= 0 && !audio_disable)
                 audio_index = i;
             break;
         case CODEC_TYPE_VIDEO:
-            if ((video_index < 0 || wanted_video_stream-- > 0) && !video_disable)
+            if (wanted_video_stream-- >= 0 && !video_disable)
                 video_index = i;
             break;
         case CODEC_TYPE_SUBTITLE: