[MPlayer-cvslog] r23790 - trunk/libmpdemux/demux_mkv.c

reimar subversion at mplayerhq.hu
Mon Jul 16 16:01:53 CEST 2007


Author: reimar
Date: Mon Jul 16 16:01:53 2007
New Revision: 23790

Log:
Avoid crash if a non-existent audio track is selected with -aid


Modified:
   trunk/libmpdemux/demux_mkv.c

Modified: trunk/libmpdemux/demux_mkv.c
==============================================================================
--- trunk/libmpdemux/demux_mkv.c	(original)
+++ trunk/libmpdemux/demux_mkv.c	Mon Jul 16 16:01:53 2007
@@ -2520,6 +2520,11 @@ demux_mkv_open (demuxer_t *demuxer)
   else if (demuxer->audio->id != -2)  /* -2 = no audio at all */
     track = demux_mkv_find_track_by_num (mkv_d, demuxer->audio->id,
                                          MATROSKA_TRACK_AUDIO);
+  if (track && demuxer->a_streams[track->tnum])
+    {
+      demuxer->audio->id = track->tnum;
+      demuxer->audio->sh = demuxer->a_streams[track->tnum];
+    }
   else
     {
       mp_msg (MSGT_DEMUX, MSGL_INFO, MSGTR_MPDEMUX_MKV_NoAudioTrackFound);
@@ -2534,11 +2539,6 @@ demux_mkv_open (demuxer_t *demuxer)
           continue;
       if(demuxer->a_streams[track->tnum])
         {
-          if(track && mkv_d->tracks[i] == track)
-            {
-              demuxer->audio->id = track->tnum;
-              demuxer->audio->sh = demuxer->a_streams[track->tnum];
-            }
           mkv_d->last_aid++;
           if(mkv_d->last_aid == MAX_A_STREAMS)
             break;



More information about the MPlayer-cvslog mailing list