Browse code

Apply the same logic used for subtitle stream selection to audio and video 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".

Originally committed as revision 17693 to svn://svn.ffmpeg.org/ffmpeg/trunk

Stefano Sabatini authored on 2009/03/02 02:06:01
Showing 1 changed files
... ...
@@ -1974,11 +1974,11 @@ static int decode_thread(void *arg)
1974 1974
         ic->streams[i]->discard = AVDISCARD_ALL;
1975 1975
         switch(enc->codec_type) {
1976 1976
         case CODEC_TYPE_AUDIO:
1977
-            if ((audio_index < 0 || wanted_audio_stream-- > 0) && !audio_disable)
1977
+            if (wanted_audio_stream-- >= 0 && !audio_disable)
1978 1978
                 audio_index = i;
1979 1979
             break;
1980 1980
         case CODEC_TYPE_VIDEO:
1981
-            if ((video_index < 0 || wanted_video_stream-- > 0) && !video_disable)
1981
+            if (wanted_video_stream-- >= 0 && !video_disable)
1982 1982
                 video_index = i;
1983 1983
             break;
1984 1984
         case CODEC_TYPE_SUBTITLE: