[vlc-devel] [PATCH] Preliminary dual subtitles support.

Roland Bewick roland.bewick at gmail.com
Wed Apr 24 13:19:59 CEST 2019


Hi Thomas, Francois and Rémi, thanks for your feedback.

> This feature should be disabled by default.
> So, the ES_OUT_ES_POLICY_SIMULTANEOUS should depend on a VLC option.

You're right. I've considered your advice.

When a user opens a video with embedded sub tracks, most wouldn't expect 
selecting another track to enable both of them, especially because they 
mightn't have set their default subtitle language.

If two external sub tracks are opened however, the user probably wants 
to display both of them.

To be consistent, I think it's better to have an "enable dual subtitles" 
option which is disabled by default, as you previously suggested.


> changing policy will clearly break all auto deselection by demuxers

Please correct me if I'm wrong,

but as far as I can tell, there are two demuxers that modify the 
exclusive / simultaneous policy (ASF and MKV) so that only a single 
video track can be selected at once.

Because the change I made only effects the selection of subtitles I 
think the change will not break any existing auto deselection functionality.

For example, when I open a new video file, all the subtitles I 
previously opened are still removed, leaving a blank state as expected.


> Do you really need this variable ?

No, I've thought of a way to simplify this. Thanks.


> Why ? Is the secondary SPU also created via EsOutCreateDecoder(), in that case, it should have its own clock, no ?

I disabled the check, and when I deselect one subtitle track they both 
disappear. They are sharing the same SPU object. I'll look into this 
further.

I do agree that they should have their own clocks. (One per SPU). I'll 
make sure the change works so that individual sub track synchronization 
can be set.


> In my experience, duolingual subtitles are stacked together www by 
> default, at the bottom. I think content producers and consumers alike 
> expect the subtitles at the bottom, not the top of the picture.
Ok, It might be better to add settings for primary and secondary 
subtitle alignment, and only set override if the user has specified.


> And as François hinted, hard-coding an alignment will break existing 
> settings.
He said it wouldn't as long as there wasn't an existing bug. The codecs 
were designed to load settings from user config. The codecs themselves 
however OR'd in the bottom position in the case the user only set 
horizontal alignment. I simply removed that hard coding so that vertical 
alignment can also be set.

Setting the alignment in this way does have a disadvantage though: The 
decoder has to be recreated if the user changes the subtitle alignment 
on the fly.


If I do have user options to override the alignment, maybe injecting 
directly the user-overridden alignment into 
vout_subpictures.c:SpuRenderRegion could be an option.

I'd not have to touch any of the decoders this way.


Roland



More information about the vlc-devel mailing list