Commit 2a8dda4c authored by Thomas Guillem's avatar Thomas Guillem

input: use the original demux for slave synchronisation

When using a renderer, the filtered demux will report the time currently
displayed by the renderer. If slaves synchronize to this time, SPU or other ES
tracks will always come too late. To fix this issue, we fetch the time on the
original demux (that will report the time being buffered).

This could be removed in VLC 4.0 in favor of a new demux control, like
parent ffc0159b
......@@ -2563,6 +2563,7 @@ static input_source_t *InputSourceNew( input_thread_t *p_input,
TAB_CLEAN( count, tab );
in->p_original_demux =
in->p_demux = InputDemuxNew( p_input, in, psz_access, psz_demux,
psz_path, psz_anchor );
......@@ -2769,7 +2770,7 @@ static void SlaveDemux( input_thread_t *p_input )
int64_t i_time;
int i;
if( demux_Control( input_priv(p_input)->master->p_demux, DEMUX_GET_TIME, &i_time ) )
if( demux_Control( input_priv(p_input)->master->p_original_demux, DEMUX_GET_TIME, &i_time ) )
msg_Err( p_input, "demux doesn't like DEMUX_GET_TIME" );
......@@ -50,6 +50,9 @@ typedef struct
demux_t *p_demux; /**< Demux object (most downstream) */
demux_t *p_original_demux; /**< Unfiltered demux. Can be used to fetch the
* original time for slave synchronisation. */
/* Title infos for that input */
bool b_title_demux; /* Titles/Seekpoints provided by demux */
int i_title;
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment