[MPlayer-dev-eng] [PATCH] Make all subtitles availiable

Guillaume POIRIER poirierg at gmail.com
Sun Dec 3 21:38:08 CET 2006


Hi,

On 11/30/06, Lehel Bernadt <lehel at pmc-services.hu> wrote:
> On Wednesday 29 November 2006 15:47, Sturle Sunde wrote:
> > Some DVDs have gaps in the subtitle tracks, like this one:
> >
> >   subtitle ( sid ): 0 language: da
> >   ID_SUBTITLE_ID=1
> >   ID_SID_0_LANG=da
> >   subtitle ( sid ): 1 language: sv
> >   ID_SUBTITLE_ID=3
> >   ID_SID_1_LANG=sv
> >   subtitle ( sid ): 2 language: no
> >   ID_SUBTITLE_ID=5
> >   ID_SID_2_LANG=no
> >   subtitle ( sid ): 3 language: fi
> >   ID_SUBTITLE_ID=7
> >   ID_SID_3_LANG=fi
> >   number of subtitles on disk: 4
> >   CHAPTERS:
> > 00:00:00,00:00:55,00:02:34,00:07:51,00:12:29,00:14:50,00:22:05,00:28:35,00:
> >33:39,00:42:17,00:45:19,00:52:10,00:57:57,01:03:56,01:07:47,01:14:22,01:19:5
> >0,01:23:26,01:28:57, Selected DVD subtitle channel: 2 language: no
> >
> > When i play this DVD with -slang no, i get swedish subtitles because
> > it plays subtitle ID 2, not 5.  (No 2 is valid, see below.)  I guess
> > this is the same bug that Mogens Kjær reported to MPlayer-users at
> > July 21.  I can choose between Danish and Swedish subtitles with the
> > -sid option, or by cycling, but Norwegian and Finnish are unavailiable
> > because the IDs are above the detected number of subtitles.
> >
> > Here is a simple patch to make all detected subtitle IDs availiable,
> > even when there are gaps in the numbering.  It changes the numbering
> > and IDs to be more similar to the method used by audio tracks.
>
> I have a more simple (and correct) patch for this, which i posted to the list
> twice already, but it seems like the dvd stuff is maintained by nobody, so no
> one was willing to apply it until now.
> The patch to today's svn is attached, please see if it works for you.
>
> The problem with yours is that it uses the spu stream id as the subtitle id,
> and that breaks the subtitle selection logic of mplayer because there should
> be no gaps in the  subtitle numbering.
>
> >
> > Btw: The subtitle tracks in between show up as debugging output when i
> > play the DVD, just after the actual playback has started, but are
> > still unavailiable on an unpatched version.  Like this:
> >
> >   ID_SUBTITLE_ID=24 A-V:  0.016 ct:  0.038  29/ 29 68% 17% 22.8% 7 0
> >   ID_SUBTITLE_ID=3
> >   ID_SUBTITLE_ID=0
> >   ID_SUBTITLE_ID=1
> >   ID_SUBTITLE_ID=4
> >   ID_SUBTITLE_ID=5
> >   ID_SUBTITLE_ID=6
> >   ID_SUBTITLE_ID=7
>
> The reason for this is that the missing subs are the same as the present ones,
> only formatted for widescreen display. A lot of 16:9 dvds have subs formatted
> for both 4:3 letterboxed and 16:9 display. Mplayer ignores the 16:9 version,
> that's why they are not selectable.

I've just tested your patch on a DVD that was problematic (LOTR 2
Towers, long ed.) and it works fine.
I haven't tried with your patch + Nico's suggested fix yet though.

Guillaume
-- 
An association of men who will not quarrel with one another is a thing
which has never yet existed, from the greatest confederacy of nations
down to a town meeting or a vestry.
 -- Thomas Jefferson
(when interviewed about MPlayer ML flamewars)
http://www.brainyquote.com/quotes/quotes/t/thomasjeff157207.html


More information about the MPlayer-dev-eng mailing list