changeset 15004:ec7bd6ad70b5

discard streams we dont need
author michael
date Fri, 25 Mar 2005 00:48:18 +0000
parents c0afa00b428c
children 4abf8628ee74
files libmpdemux/demux_lavf.c
diffstat 1 files changed, 14 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/libmpdemux/demux_lavf.c	Thu Mar 24 06:47:49 2005 +0000
+++ b/libmpdemux/demux_lavf.c	Fri Mar 25 00:48:18 2005 +0000
@@ -198,8 +198,12 @@
             sh_audio->channels= codec->channels;
             sh_audio->samplerate= codec->sample_rate;
             if(verbose>=1) print_wave_header(sh_audio->wf);
-            demuxer->audio->id=i;
-            demuxer->audio->sh= demuxer->a_streams[i];
+            if(demuxer->audio->id != i && demuxer->audio->id != -1)
+                st->discard= AVDISCARD_ALL;
+            else{
+                demuxer->audio->id = i;
+                demuxer->audio->sh= demuxer->a_streams[i];
+            }
             break;}
         case CODEC_TYPE_VIDEO:{
             BITMAPINFOHEADER *bih=calloc(sizeof(BITMAPINFOHEADER) + codec->extradata_size,1);
@@ -237,9 +241,15 @@
     int  	biYPelsPerMeter;
     int 	biClrUsed;
     int 	biClrImportant;*/
-            demuxer->video->id=i;
-            demuxer->video->sh= demuxer->v_streams[i];            
+            if(demuxer->video->id != i && demuxer->video->id != -1)
+                st->discard= AVDISCARD_ALL;
+            else{
+                demuxer->video->id = i;
+                demuxer->video->sh= demuxer->v_streams[i];
+            }
             break;}
+        default:
+            st->discard= AVDISCARD_ALL;
         }
     }