[MPlayer-users] subtitle disordered when using slave mode

Reimar Döffinger Reimar.Doeffinger at gmx.de
Mon Apr 25 10:59:40 CEST 2011


On Mon, Apr 25, 2011 at 02:07:45AM +0000, Zongyao QU wrote:
> Reimar Döffinger <Reimar.Doeffinger <at> gmx.de> writes:
> > 
> > On Sun, Apr 24, 2011 at 08:11:54AM +0000, Zongyao QU wrote:
> > > how to reproduce the bug?
> > > 
> > > 1. open a file with internal subtitle, for example, XXX.mkv
> > >  ./mplayer -slave -quiet -font xxx.ttf  XXX.mkv
> > > 
> > > 2. set_property sub 0
> > > then you could make sure that 0 means 
> > > the internal sub track.
> > > 
> > > 3. use sub_load to load another subtitle
> > > sub_load aaa/bbb/ccc.srt
> > > 
> > > 4. set_property sub 0
> > > you will see that the ccc.srt will be displayed.
> > > 
> > > but
> > > set_property sub 1 
> > > will make internal sub displayed.
> > > 
> > > I think the sub track id should be consistent, but it is not
> > > 
> > > and this seams only happens when
> > > 1. internal + external sub
> > > 2. external sub should be loaded in the runtime, 
> > >      rather than by the cmdline
> > 
> > Uh, I don't see how this should be possible to solve, there
> > is no way to have two subs with id 0, and having the internal
> > subs first would result in a total mess e.g. with MPEG-TS where
> > new internal subtitles could be added at any point.
> > You are aware of the sub_demux, sub_file and sub_vob properties?!
> 
> Thank you for you reply.
> But I don't think it is the reason of set_property sub should mis-behave.
> 
> Dug into the code a little bit, the parameter used in [set_property sub] is 
> mpctx->global_sub_pos,
> in sub_source_and_index_by_pos, which is called in sub_source and 
> sub_source_pos, 
> 
> since SUB_SOURCE_SUBS is 0, SUB_SOURCE_DEMUX is 2, so that, the SUBS subs are 
> always found first, then the DEMUX subs.

Yes, and as I tried to explain doing it the other way round is far worse.
Now, the demuxer sub ids will change in a predictable way when you manually
add a new sub file.
If you change it, the external sub ids will change in a completely unpredictable
way whenever a new internal sub is detected (which can be at any moment).
The current implementation, as far as I can tell, provides the most
stable/predictable global sub ids that are generally possible.
For cases where this is not sufficient sub_demux etc. exist.


More information about the MPlayer-users mailing list