[MPlayer-cvslog] r23786 - trunk/command.c

Reimar Döffinger Reimar.Doeffinger at stud.uni-karlsruhe.de
Thu Aug 9 11:52:02 CEST 2007


Hello,
On Tue, Aug 07, 2007 at 11:06:48AM +0200, Carl Eugen Hoyos wrote:
> On 2007-07-15 17:56, reimar wrote:
> > Author: reimar
> > Date: Sun Jul 15 19:56:06 2007
> > New Revision: 23786
> > 
> > Log:
> > Make sure that sub->id is -2 and sub->sh is NULL if subtitle doesn't
> > exist. Probably sanest way to avoid crash in e.g. mov demuxer without
> > having to check both all the time.
> 
> This patch partly broke dvd subtitles: It is now necessary to press "j"
> once to show any subtitles.

I thought I had already sent this, but it seems I did not.
Could you test attached patch?
It's not beautiful but not too ugly either IMO and better than reverting
this change I think.

Greetings,
Reimar Döffinger
-------------- next part --------------
Index: libmpdemux/demuxer.c
===================================================================
--- libmpdemux/demuxer.c	(revision 24031)
+++ libmpdemux/demuxer.c	(working copy)
@@ -209,6 +209,8 @@
   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 @@
     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