[MPlayer-dev-eng] [PATCH] Make all subtitles availiable
Lehel Bernadt
lehel at pmc-services.hu
Sun Dec 10 14:52:16 CET 2006
On Sunday 10 December 2006 14:25, Reimar Döffinger wrote:
>
> > --- mplayer/mencoder.c 2006-12-10 13:46:54.656984695 +0100
> > +++ mplayer-mine/mencoder.c 2006-12-10 13:50:06.767779415 +0100
> > @@ -571,6 +571,8 @@
> > if(stream->type==STREAMTYPE_DVD){
> > if(audio_lang && audio_id==-1)
> > audio_id=dvd_aid_from_lang(stream,audio_lang); if(dvdsub_lang &&
> > dvdsub_id==-2) dvdsub_id=dvd_sid_from_lang(stream,dvdsub_lang); + //
> > switch to the spu id
> > + dvdsub_id = ((dvd_priv_t*)stream->priv)->subtitles[dvdsub_id].id;
> > }
> > #endif
> >
> > diff -urN mplayer/mplayer.c mplayer-mine/mplayer.c
> > --- mplayer/mplayer.c 2006-12-10 13:46:54.633988191 +0100
> > +++ mplayer-mine/mplayer.c 2006-12-10 13:50:06.773778503 +0100
> > @@ -2341,7 +2341,9 @@
> > if (d_dvdsub) {
> > #ifdef USE_DVDREAD
> > if (vo_spudec && stream->type == STREAMTYPE_DVD) {
> > - d_dvdsub->id = dvdsub_id;
> > + // d_dvdsub->id is the spu stream to be selected
> > + // dvdsub_id contains the -sid value
> > + d_dvdsub->id =
> > ((dvd_priv_t*)stream->priv)->subtitles[dvdsub_id].id;
>
> Are you sure it is correct that once it is d_dvdsub->id and once
> dvdsub_id that gets the spu id? That seems likely to break embedded
> subtitles...
Well theoretically dvdsub_id should get the spu id in mplayer.c as well... but
that would seriously break things, since dvdsub_id is also used as an index
into the set_of_subtitles array. That's why i left it with the sid value, and
fortunately it's not used in any other way, because its value is assigned to
d_dvdsub->id before the sub display. And that's where my patch comes in.
Now in mencoder.c, this assignment is not done, so i had to change dvdsub_id
itself, but here this change poses no problem. And d_dvdsub->id is not used
in mencoder.c at all.
So basically two different executables, two different approaches. I know it's
a bit confusing, but i think for a more consistent code a redesign of the
subtitle system would be needed.
Best wishes,
Lehel
More information about the MPlayer-dev-eng
mailing list