]> rtime.felk.cvut.cz Git - frescor/ffmpeg.git/commitdiff
Set AVStream.discard, so that demuxers can choose which stream to select if that...
authorrbultje <rbultje@9553f0bf-9b14-0410-a0b8-cfaf0461ba5b>
Mon, 18 Aug 2008 17:09:34 +0000 (17:09 +0000)
committerrbultje <rbultje@9553f0bf-9b14-0410-a0b8-cfaf0461ba5b>
Mon, 18 Aug 2008 17:09:34 +0000 (17:09 +0000)
git-svn-id: file:///var/local/repositories/ffmpeg/trunk@14825 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b

ffplay.c

index 74c97c5020b7453512dec6c5b07c2ee05164fe0a..feb4bae0062a3b4be4a5bd4fc8f96ae9c1ce4556 100644 (file)
--- a/ffplay.c
+++ b/ffplay.c
@@ -1773,6 +1773,7 @@ static int stream_component_open(VideoState *is, int stream_index)
     if(thread_count>1)
         avcodec_thread_init(enc, thread_count);
     enc->thread_count= thread_count;
+    ic->streams[stream_index]->discard = AVDISCARD_DEFAULT;
     switch(enc->codec_type) {
     case CODEC_TYPE_AUDIO:
         is->audio_stream = stream_index;
@@ -1869,6 +1870,7 @@ static void stream_component_close(VideoState *is, int stream_index)
         break;
     }
 
+    ic->streams[stream_index]->discard = AVDISCARD_ALL;
     avcodec_close(enc);
     switch(enc->codec_type) {
     case CODEC_TYPE_AUDIO:
@@ -1979,6 +1981,7 @@ static int decode_thread(void *arg)
 
     for(i = 0; i < ic->nb_streams; i++) {
         AVCodecContext *enc = ic->streams[i]->codec;
+        ic->streams[i]->discard = AVDISCARD_ALL;
         switch(enc->codec_type) {
         case CODEC_TYPE_AUDIO:
             if ((audio_index < 0 || wanted_audio_stream-- > 0) && !audio_disable)