[vlc-devel] [RFC] Solving the slave input program hijacking

Francois Cartegnie fcvlcdev at free.fr
Fri May 26 14:50:45 CEST 2017


Hi,

Program hijacking happens when a slave (audio/spu) is present and when
one of its es_out controls requiring group comes first. (takes the
slave/default program instead of the master program).
Usual controls are SET_[GROUP_]PCR, and the ES_OUT_ADD.
In case of TS this totally breaks playback.

The root of the issue is that es_out controls only provides a reference
to itself, which prevents identifying/differentiating (in the case of
the core main implementation) the input (input_source, demux) issuing
the control.

To solve this we need to provide a second reference to an opaque
(because each es_out can re-implemented locally), and this reference
needs to be passed with each control.

In the case of regular es_out, this would store, for example, a
reference to the input_source and pass it, allowing to check if it
against the master one or slaves ones.


Way 1:
- Modify the es_out Control API with a second leading parameter

es_out_Control( es_out_t *, es_src_t *, i_query, ... );

This would break the usual single parameter uniformity we have with
controls. That would also require to change every calling place.


Way 2:
- Add an es_out_ref_t struct containing the two parameters which would
be only used at call time. The stored control will unpack/store to two
arguments.
That would reduce changes in modules. Unsure about timeshift reissuing.


Way 3:
- Split es_out_t in es_out_t then use indirection
renames es_out_t to es_out_impl_t, and es_out_t would contain a pointer
to es_out_impl_t and to opaque.
This requires minimal changes, but need the core to store an es_out_t
struct for two es_impl (display + timeshift) for each input_source.


I have test branches with 1 & 3, but both seems inelegant.


Francois


More information about the vlc-devel mailing list