[vlc-devel] Seeking opinions

tony hugh1234 at mail.ustc.edu.cn
Thu Sep 10 13:06:26 CEST 2015

Thanks for replying.

> However I don't see how that could
> happen: LibVLC and the GUI both only allow a single track to be
> selected
> or not. There are no provisions for a track to be selected more than
> once at a time.

I already dealt with this by adding a hotkey to change a global vlc
object I created, called "spu-es2, who shares the same choices as
"spu-es". I want to add it to qt later.

> It seems to me that this "duplication" feature is orthogonal to the
> "multiple simultaneous subtitle" feature. I would suggest first
> getting multiple different subtitle tracks to work. You can always
> add duplication afterwards.

I did get it to work. And then, I encountered the problem I described.

To fix it, I temporally added an additional decoder_t pointer in
es_out_id_t by changing p_dec to p_dec[2],
and I found out that a block can be duplicated and sent to
multiple decoders, and it indeed can display the same subtitles twice
as the user wishes. I tested it on own ubuntu laptop and it worked well:
both 1st and 2nd subtitle can be cycled arbitrarily.

But for video and audio which doesn't need this additional pointer,
I feel uncomfortable about using p_dec[2].

Another benefit of using a linked list
(or maybe other structure that can achieve this effect)
is: the p_dec_record doesn't have to be there at the beginning,
either, if not used.
It can be added to any es_out_id_t later as wish.

Of course We can use a fixed number of decoder pointers
to achieve this. The memory waste should be trivial.
But if there shall be other needs other than recording and
a 2nd subtitle in the future, we have to add pointers again.

More information about the vlc-devel mailing list