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

Evgeniy Stepanov eugeni.stepanov at gmail.com
Tue Jan 29 16:24:43 CET 2008


On Tuesday 29 January 2008 18:06:50 Reimar Döffinger wrote:
> Hello,
>
> On Tue, Jan 29, 2008 at 03:30:54PM +0100, reimar wrote:
> > Author: reimar
> > Date: Tue Jan 29 15:30:53 2008
> > New Revision: 25909
> >
> > Log:
> > Make mov subtitles work with -ass
> >
> >
> > Modified:
> >    trunk/libmpdemux/demuxer.c
> >
> > Modified: trunk/libmpdemux/demuxer.c
> > =========================================================================
> >===== --- trunk/libmpdemux/demuxer.c	(original)
> > +++ trunk/libmpdemux/demuxer.c	Tue Jan 29 15:30:53 2008
> > @@ -844,7 +844,7 @@ int biComp=le2me_32(sh_video->bih->biCom
> >         sh->ass_track = ass_new_track(ass_library);
> >         if (sh->ass_track && sh->extradata)
> >           ass_process_codec_private(sh->ass_track, sh->extradata,
> > sh->extradata_len); -     } else if (sh && sh->type == 't')
> > +     } else if (sh && sh->type != 'v')
> >         sh->ass_track = ass_default_track(ass_library);
>
> Btw. is there some reason I am missing why this cannot be done in
> mpcommon.c?
> It seems overkill to me to initialize ass_track for all tracks at once,
> I think that mpcommon could just check if it is NULL and if yes allocate
> it...
> I am also asking because it took me quite some time to find this place
> to fix the problem with mov subtitles not working with -ass...

I did it this way because I generally try to avoid lazy initialization. It can 
introduce unexpected delays or changes in behaviour (for example, fontconfig 
updating font cache when the first subtitle is about to be displayed --- 
that's a real life example :) ). Also, what will happen if ass_track could 
not be created for some reason ? It be repeated over and over for each 
subtitle.

In this case, track creation is fast and never fails, but it may change in the 
future (though unlikely).



More information about the MPlayer-cvslog mailing list