[MPlayer-advusers] reproducible crash in r23784

Reimar Döffinger Reimar.Doeffinger at stud.uni-karlsruhe.de
Tue Jul 17 17:22:13 CEST 2007


Hello,
On Mon, Jul 16, 2007 at 08:43:15PM +0200, Dominik 'Rathann' Mierzejewski wrote:
> On Monday, 16 July 2007 at 20:11, Reimar Doeffinger wrote:
> > Hello,
> > On Mon, Jul 16, 2007 at 06:45:17PM +0200, Dominik 'Rathann' Mierzejewski wrote:
> > > On Sunday, 15 July 2007 at 19:57, Reimar Döffinger wrote:
> > > > Hello,
> > > > On Sun, Jul 15, 2007 at 06:13:26PM +0200, Dominik 'Rathann' Mierzejewski wrote:
> > > > > Sample is in our sample collection:
> > > > > http://samples.mplayerhq.hu/sub/NeroMP4/unsupported-embedded-subs-2.mp4
> > > > > 
> > > > > This happens whenever I press 'j' during playback.
> > > > 
> > > > Fixed, though it might break demuxers that do not fill sub->s_streams
> > > > correctly (though I do not know of any demuxers where that is still the
> > > > case).
> > > 
> > > Fixed the crash, yes, but now the subtitles behave weird. If I don't specify
> > > -sid 2, it's impossible to switch to the subtitles on using 'j'.
> > 
> > With that file (I think it has only one subtitle?) or with some other
> > file?
> 
> With that file. It does have just one subtitle. I haven't tested others.

Not caused by that patch, problem is our sid numbering is a real mess.
Attached patch lets you select the subtitle, though it will also allow
you to select -sid 0 and -sid 1 which do not actually exist.
Though that could possibly fixed again in command.c, but it would still
be a mess.

Greetings,
Reimar Döffinger
-------------- next part --------------
Index: mplayer.c
===================================================================
--- mplayer.c	(revision 23790)
+++ mplayer.c	(working copy)
@@ -3012,11 +3012,13 @@
 
 if (mpctx->stream->type != STREAMTYPE_DVD && mpctx->stream->type != STREAMTYPE_DVDNAV) {
   int i;
+  int maxid = -1;
   // setup global sub numbering
   mpctx->global_sub_indices[SUB_SOURCE_DEMUX] = mpctx->global_sub_size; // the global # of the first demux-specific sub.
   for (i = 0; i < MAX_S_STREAMS; i++)
     if (mpctx->demuxer->s_streams[i])
-      mpctx->global_sub_size++;
+      maxid = FFMAX(maxid, ((sh_sub_t *)mpctx->demuxer->s_streams[i])->sid);
+  mpctx->global_sub_size += maxid + 1;
 }
 if (mpctx->global_sub_size <= dvdsub_id) mpctx->global_sub_size = dvdsub_id + 1;
 


More information about the MPlayer-advusers mailing list