[MPlayer-dev-eng] [PATCH] combine vobsub_lang with sub_select

Joey Parrish joey at nicewarrior.org
Tue Aug 24 18:50:39 CEST 2004


On Tue, Aug 24, 2004 at 12:21:06PM +0200, Moritz Bunkus wrote:
> First, sorry that I haven't spoken up earlier. I simply lack the time to
> look at patches at the moment.
> 
> > -if(d_dvdsub->id >= 0 && vo_spudec==NULL && sh_video){
> > +if(vo_spudec==NULL && sh_video && stream->type==STREAMTYPE_DVD){
> 
> This breaks Vobsub-in-Matroska. Is it ok if I change this to...
> 
> > +if(vo_spudec==NULL && sh_video && (stream->type==STREAMTYPE_DVD || demuxer->type==DEMUXER_TYPE_MATROSKA)){

Yes, please.  I am ignorant of matroska, so please fix my mistakes!  :)

> > +++ main.dev/libmpdemux/demux_ogg.c	2004-08-12 23:56:21.698918400 +0000
> > @@ -655,12 +655,18 @@
> >  extern void print_wave_header(WAVEFORMATEX *h);
> >  extern void print_video_header(BITMAPINFOHEADER *h);
> >  
> > +static int n_text = 0;
> > +static int *text_ids = NULL;
> > +
> > +int demux_ogg_num_subs() { return n_text; }
> > +int demux_ogg_sub_id(int index) { return (index < 0) ? index :
> > text_ids[index]; }
> 
> Yuck! Why are you using globals? This will break if the demuxer is used
> twice, e.g. with '-audiofile'. If the second file contains subs...

Ah, sorry.  Would you like me to do this, or will you fix it when you
commit your fix for the matroska stuff?

> Please put those variables into the ogg_demuxer_t structure and add a
> 'demuxer_t *' parameter to each of the two functions. demuxer->priv is
> the ogg_demuxer_t from which you can then get the information.
> 
> > +          text_ids = (int *)realloc(text_ids, sizeof(int) * n_text);
> 
> This memory is never freed. Another reason to put it into the
> ogg_demuxer_t. Free it in the demux_ogg_close function (or whatever it
> is named).
> 
> I've got subtitle switching working for Matroska, too, with both text
> and VobSubs. I'll commit it soon.

Thanks, I'm glad to see this sub switching code grow.

--Joey

-- 
"The greatest thing you'll ever learn
is just to love and be loved in return." -- Darth Vader




More information about the MPlayer-dev-eng mailing list