[MPlayer-cvslog] r24042 - trunk/libmpdemux/demuxer.c

reimar subversion at mplayerhq.hu
Thu Aug 9 12:26:00 CEST 2007


Author: reimar
Date: Thu Aug  9 12:26:00 2007
New Revision: 24042

Log:
When a new subtitle stream becomes available check if it is the one that
was requested by the user and set up sub->id and sub->sh accordingly.
Fixes -slang and -sid with DVD subtitles (basically only 'j' during playback
could make them show). This was broken by r23786.


Modified:
   trunk/libmpdemux/demuxer.c

Modified: trunk/libmpdemux/demuxer.c
==============================================================================
--- trunk/libmpdemux/demuxer.c	(original)
+++ trunk/libmpdemux/demuxer.c	Thu Aug  9 12:26:00 2007
@@ -209,6 +209,8 @@ demuxer_t* new_demuxer(stream_t *stream,
   return d;
 }
 
+extern int dvdsub_id;
+
 sh_sub_t *new_sh_sub_sid(demuxer_t *demuxer, int id, int sid) {
   if (id > MAX_S_STREAMS - 1 || id < 0) {
     mp_msg(MSGT_DEMUXER,MSGL_WARN,"Requested sub stream id overflow (%d > %d)\n",
@@ -222,6 +224,10 @@ sh_sub_t *new_sh_sub_sid(demuxer_t *demu
     demuxer->s_streams[id] = sh;
     sh->sid = sid;
     mp_msg(MSGT_IDENTIFY, MSGL_INFO, "ID_SUBTITLE_ID=%d\n", sid);
+    if (dvdsub_id == id) {
+      demuxer->sub->id = id;
+      demuxer->sub->sh = sh;
+    }
   }
   return demuxer->s_streams[id];
 }



More information about the MPlayer-cvslog mailing list