ES_OUT_SET_META, /* arg1=const vlc_meta_t * */
/* PCR system clock manipulation for external clock synchronization */
- ES_OUT_GET_PCR_SYSTEM, /* arg1=mtime_t * res=can fail */
+ ES_OUT_GET_PCR_SYSTEM, /* arg1=mtime_t *, arg2=mtime_t * res=can fail */
ES_OUT_MODIFY_PCR_SYSTEM, /* arg1=int is_absolute, arg2=mtime_t, res=can fail */
/* First value usable for private control */
return es_out_Control( out, ES_OUT_SET_META, p_meta );
}
-static inline int es_out_ControlGetPcrSystem( es_out_t *out, mtime_t *pi_system )
+static inline int es_out_ControlGetPcrSystem( es_out_t *out, mtime_t *pi_system, mtime_t *pi_delay )
{
- return es_out_Control( out, ES_OUT_GET_PCR_SYSTEM, pi_system );
+ return es_out_Control( out, ES_OUT_GET_PCR_SYSTEM, pi_system, pi_delay );
}
static inline int es_out_ControlModifyPcrSystem( es_out_t *out, bool b_absolute, mtime_t i_system )
{
INPUT_GET_ES_OBJECTS, /* arg1=int id, vlc_object_t **dec, vout_thread_t **, aout_instance_t ** */
/* External clock managments */
- INPUT_GET_PCR_SYSTEM, /* arg1=mtime_t * res=can fail */
+ INPUT_GET_PCR_SYSTEM, /* arg1=mtime_t *, arg2=mtime_t * res=can fail */
INPUT_MODIFY_PCR_SYSTEM,/* arg1=int absolute, arg2=mtime_t res=can fail */
};
/**
* \see input_clock_GetSystemOrigin
*/
-static inline int input_GetPcrSystem( input_thread_t *p_input, mtime_t *pi_system )
+static inline int input_GetPcrSystem( input_thread_t *p_input, mtime_t *pi_system, mtime_t *pi_delay )
{
- return input_Control( p_input, INPUT_GET_PCR_SYSTEM, pi_system );
+ return input_Control( p_input, INPUT_GET_PCR_SYSTEM, pi_system, pi_delay );
}
/**
* \see input_clock_ChangeSystemOrigin
static mtime_t GetPcrSystem(input_thread_t *input)
{
int canc = vlc_savecancel();
+ /* TODO use the delay */
mtime_t system;
- if (input_GetPcrSystem(input, &system))
+ if (input_GetPcrSystem(input, &system, NULL))
system = -1;
vlc_restorecancel(canc);
int canc = vlc_savecancel();
mtime_t client_system;
- if (!input_GetPcrSystem(sys->input, &client_system)) {
+ if (!input_GetPcrSystem(sys->input, &client_system, NULL)) {
const mtime_t diff_system = client_system - master_system - diff_date;
if (diff_system != 0) {
input_ModifyPcrSystem(sys->input, true, master_system - diff_date);
vlc_mutex_unlock( &cl->lock );
}
-mtime_t input_clock_GetSystemOrigin( input_clock_t *cl )
+void input_clock_GetSystemOrigin( input_clock_t *cl, mtime_t *pi_system, mtime_t *pi_delay )
{
vlc_mutex_lock( &cl->lock );
assert( cl->b_has_reference );
- const mtime_t i_system = cl->ref.i_system;
+ *pi_system = cl->ref.i_system;
+ if( pi_delay )
+ *pi_delay = cl->i_pts_delay;
vlc_mutex_unlock( &cl->lock );
-
- return i_system;
}
#warning "input_clock_SetJitter needs more work"
void input_clock_ChangePause( input_clock_t *, bool b_paused, mtime_t i_date );
/**
- * This function returns the original system value date for the current
+ * This function returns the original system value date and the delay for the current
* reference point (a valid reference point must have been set).
*/
-mtime_t input_clock_GetSystemOrigin( input_clock_t * );
+void input_clock_GetSystemOrigin( input_clock_t *, mtime_t *pi_system, mtime_t *pi_delay );
/**
* This function allows to rebase the original system value date (a valid
case INPUT_GET_PCR_SYSTEM:
{
mtime_t *pi_system = va_arg( args, mtime_t * );
- return es_out_ControlGetPcrSystem( p_input->p->p_es_out_display, pi_system );
+ mtime_t *pi_delay = va_arg( args, mtime_t * );
+ return es_out_ControlGetPcrSystem( p_input->p->p_es_out_display, pi_system, pi_delay );
}
case INPUT_MODIFY_PCR_SYSTEM:
return VLC_EGENERIC;
mtime_t *pi_system = va_arg( args, mtime_t *);
- *pi_system = input_clock_GetSystemOrigin( p_pgrm->p_clock );
+ mtime_t *pi_delay = va_arg( args, mtime_t *);
+ input_clock_GetSystemOrigin( p_pgrm->p_clock, pi_system, pi_delay );
return VLC_SUCCESS;
}
return VLC_EGENERIC;
mtime_t *pi_system = (mtime_t*)va_arg( args, mtime_t * );
- return es_out_ControlGetPcrSystem( p_sys->p_out, pi_system );
+ mtime_t *pi_delay = (mtime_t*)va_arg( args, mtime_t * );
+ return es_out_ControlGetPcrSystem( p_sys->p_out, pi_system, pi_delay );
}
case ES_OUT_MODIFY_PCR_SYSTEM:
{