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

Moritz Bunkus moritz at bunkus.org
Tue Aug 24 12:21:06 CEST 2004


Hi,

re-writing this because you seem not to be subscribed to the CVS ml. 

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)){

? Or will this collide with your changes?

> +++ 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...

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.

Mosu

-- 
If Darl McBride was in charge, he'd probably make marriage
unconstitutional too, since clearly it de-emphasizes the commercial
nature of normal human interaction, and probably is a major impediment
to the commercial growth of prostitution. - Linus Torvalds




More information about the MPlayer-dev-eng mailing list