[MPlayer-dev-eng] [PATCH] Give more information about vid/aid/sid tracks in mkv container

James . jazzrz86 at gmail.com
Sat Dec 15 14:12:07 CET 2007


The following patch allows external gui's to know more about whether a track
has the default flag set, this is very useful for gui's so that they can
make correct decisions about which track to play:

diff -Naur mplayer/libmpdemux/demux_mkv.c mplayer.new/libmpdemux/demux_mkv.c
--- mplayer/libmpdemux/demux_mkv.c    2007-12-15 17:29:47.518984826 +1100
+++ mplayer.new/libmpdemux/demux_mkv.c    2007-12-15 17:29:00.630922136+1100
@@ -1699,6 +1699,12 @@
           demux_mkv_open_video(demuxer, mkv_d->tracks[i], vid);
           if (mkv_d->tracks[i]->name)
             mp_msg(MSGT_IDENTIFY, MSGL_INFO, "ID_VID_%d_NAME=%s\n", vid,
mkv_d->tracks[i]->name);
+
+          if (mkv_d->tracks[i]->default_track)
+            mp_msg(MSGT_IDENTIFY, MSGL_INFO, "ID_VID_%d_DEFAULTFLAG=1\n",
vid);
+          else
+            mp_msg(MSGT_IDENTIFY, MSGL_INFO, "ID_VID_%d_DEFAULTFLAG=0\n",
vid);
+
           sprintf (str, "-vid %u", vid++);
           break;
         case MATROSKA_TRACK_AUDIO:
@@ -1707,6 +1713,12 @@
           if (mkv_d->tracks[i]->name)
             mp_msg(MSGT_IDENTIFY, MSGL_INFO, "ID_AID_%d_NAME=%s\n", aid,
mkv_d->tracks[i]->name);
           mp_msg(MSGT_IDENTIFY, MSGL_INFO, "ID_AID_%d_LANG=%s\n", aid,
mkv_d->tracks[i]->language);
+
+          if (mkv_d->tracks[i]->default_track)
+            mp_msg(MSGT_IDENTIFY, MSGL_INFO, "ID_AID_%d_DEFAULTFLAG=1\n",
aid);
+          else
+            mp_msg(MSGT_IDENTIFY, MSGL_INFO, "ID_AID_%d_DEFAULTFLAG=0\n",
aid);
+
           sprintf (str, "-aid %u, -alang
%.5s",aid++,mkv_d->tracks[i]->language);
           break;
         case MATROSKA_TRACK_SUBTITLE:
@@ -1715,6 +1727,12 @@
           if (mkv_d->tracks[i]->name)
             mp_msg(MSGT_IDENTIFY, MSGL_INFO, "ID_SID_%d_NAME=%s\n", sid,
mkv_d->tracks[i]->name);
           mp_msg(MSGT_IDENTIFY, MSGL_INFO, "ID_SID_%d_LANG=%s\n", sid,
mkv_d->tracks[i]->language);
+
+          if (mkv_d->tracks[i]->default_track)
+            mp_msg(MSGT_IDENTIFY, MSGL_INFO, "ID_SID_%d_DEFAULTFLAG=1\n",
sid);
+          else
+            mp_msg(MSGT_IDENTIFY, MSGL_INFO, "ID_SID_%d_DEFAULTFLAG=0\n",
sid);
+
           sprintf (str, "-sid %u, -slang
%.5s",sid++,mkv_d->tracks[i]->language);
           break;
         }



More information about the MPlayer-dev-eng mailing list