changeset 32491:90206ba16fec

Set st->discard in the same way for audio and video, fixes -aid no longer working.
author reimar
date Sat, 06 Nov 2010 14:31:34 +0000
parents 059cc86b02dc
children 5fc287bf541a
files libmpdemux/demux_lavf.c
diffstat 1 files changed, 8 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/libmpdemux/demux_lavf.c	Wed Nov 03 16:44:13 2010 +0000
+++ b/libmpdemux/demux_lavf.c	Sat Nov 06 14:31:34 2010 +0000
@@ -333,11 +333,12 @@
             if (st->disposition & AV_DISPOSITION_DEFAULT)
               sh_audio->default_track = 1;
             if(mp_msg_test(MSGT_HEADER,MSGL_V) ) print_wave_header(sh_audio->wf, MSGL_V);
-            // select the first audio stream
-            if (!demuxer->audio->sh) {
+            // select the first audio stream if auto-selection is requested
+            if (demuxer->audio->id == -1) {
                 demuxer->audio->id = i;
                 demuxer->audio->sh= demuxer->a_streams[i];
-            } else
+            }
+            if (demuxer->audio->id != i)
                 st->discard= AVDISCARD_ALL;
             stream_id = priv->audio_streams++;
             break;
@@ -402,12 +403,13 @@
                 int biClrUsed;
                 int biClrImportant;
             */
-            if(demuxer->video->id != i && demuxer->video->id != -1)
-                st->discard= AVDISCARD_ALL;
-            else{
+            // select the first video stream if auto-selection is requested
+            if(demuxer->video->id == -1) {
                 demuxer->video->id = i;
                 demuxer->video->sh= demuxer->v_streams[i];
             }
+            if(demuxer->video->id != i)
+                st->discard= AVDISCARD_ALL;
             stream_id = priv->video_streams++;
             break;
         }