Commit 4c0a761a authored by Laurent Aimar's avatar Laurent Aimar

Prepare for maximal clock jitter configuration.

No functionnal changes.
parent 44077425
...@@ -2323,7 +2323,7 @@ static int EsOutControlLocked( es_out_t *out, int i_query, va_list args ) ...@@ -2323,7 +2323,7 @@ static int EsOutControlLocked( es_out_t *out, int i_query, va_list args )
* TODO have a mean to correctly reenter bufferization */ * TODO have a mean to correctly reenter bufferization */
es_out_Control( out, ES_OUT_RESET_PCR ); es_out_Control( out, ES_OUT_RESET_PCR );
es_out_SetJitter( out, i_pts_delay, p_sys->i_cr_average ); es_out_SetJitter( out, i_pts_delay, 0, p_sys->i_cr_average );
} }
} }
return VLC_SUCCESS; return VLC_SUCCESS;
...@@ -2599,18 +2599,19 @@ static int EsOutControlLocked( es_out_t *out, int i_query, va_list args ) ...@@ -2599,18 +2599,19 @@ static int EsOutControlLocked( es_out_t *out, int i_query, va_list args )
case ES_OUT_SET_JITTER: case ES_OUT_SET_JITTER:
{ {
mtime_t i_pts_delay = (mtime_t)va_arg( args, mtime_t ); mtime_t i_pts_delay = (mtime_t)va_arg( args, mtime_t );
mtime_t i_pts_jitter = (mtime_t)va_arg( args, mtime_t );
int i_cr_average = (int)va_arg( args, int ); int i_cr_average = (int)va_arg( args, int );
if( i_pts_delay == p_sys->i_pts_delay && if( i_pts_delay + i_pts_jitter == p_sys->i_pts_delay &&
i_cr_average == p_sys->i_cr_average ) i_cr_average == p_sys->i_cr_average )
return VLC_SUCCESS; return VLC_SUCCESS;
p_sys->i_pts_delay = i_pts_delay; p_sys->i_pts_delay = i_pts_delay + i_pts_jitter;
p_sys->i_cr_average = i_cr_average; p_sys->i_cr_average = i_cr_average;
for( int i = 0; i < p_sys->i_pgrm; i++ ) for( int i = 0; i < p_sys->i_pgrm; i++ )
input_clock_SetJitter( p_sys->pgrm[i]->p_clock, input_clock_SetJitter( p_sys->pgrm[i]->p_clock,
i_pts_delay, i_cr_average ); i_pts_delay + i_pts_jitter, i_cr_average );
return VLC_SUCCESS; return VLC_SUCCESS;
} }
......
...@@ -79,7 +79,7 @@ enum es_out_query_private_e ...@@ -79,7 +79,7 @@ enum es_out_query_private_e
ES_OUT_SET_TIMES, /* arg1=double f_position arg2=mtime_t i_time arg3=mtime_t i_length res=cannot fail */ ES_OUT_SET_TIMES, /* arg1=double f_position arg2=mtime_t i_time arg3=mtime_t i_length res=cannot fail */
/* Set jitter */ /* Set jitter */
ES_OUT_SET_JITTER, /* arg1=mtime_t i_pts_delay arg2=int i_cr_average res=cannot fail */ ES_OUT_SET_JITTER, /* arg1=mtime_t i_pts_delay arg2= mtime_t i_pts_jitter, arg2=int i_cr_average res=cannot fail */
}; };
static inline void es_out_SetMode( es_out_t *p_out, int i_mode ) static inline void es_out_SetMode( es_out_t *p_out, int i_mode )
...@@ -141,9 +141,11 @@ static inline void es_out_SetTimes( es_out_t *p_out, double f_position, mtime_t ...@@ -141,9 +141,11 @@ static inline void es_out_SetTimes( es_out_t *p_out, double f_position, mtime_t
int i_ret = es_out_Control( p_out, ES_OUT_SET_TIMES, f_position, i_time, i_length ); int i_ret = es_out_Control( p_out, ES_OUT_SET_TIMES, f_position, i_time, i_length );
assert( !i_ret ); assert( !i_ret );
} }
static inline void es_out_SetJitter( es_out_t *p_out, mtime_t i_pts_delay, int i_cr_average ) static inline void es_out_SetJitter( es_out_t *p_out,
mtime_t i_pts_delay, mtime_t i_pts_jitter, int i_cr_average )
{ {
int i_ret = es_out_Control( p_out, ES_OUT_SET_JITTER, i_pts_delay, i_cr_average ); int i_ret = es_out_Control( p_out, ES_OUT_SET_JITTER,
i_pts_delay, i_pts_jitter, i_cr_average );
assert( !i_ret ); assert( !i_ret );
} }
static inline int es_out_GetEsObjects( es_out_t *p_out, int i_id, static inline int es_out_GetEsObjects( es_out_t *p_out, int i_id,
......
...@@ -132,6 +132,7 @@ typedef struct attribute_packed ...@@ -132,6 +132,7 @@ typedef struct attribute_packed
struct struct
{ {
mtime_t i_pts_delay; mtime_t i_pts_delay;
mtime_t i_pts_jitter;
int i_cr_average; int i_cr_average;
} jitter; } jitter;
} u; } u;
...@@ -1426,9 +1427,11 @@ static int CmdInitControl( ts_cmd_t *p_cmd, int i_query, va_list args, bool b_co ...@@ -1426,9 +1427,11 @@ static int CmdInitControl( ts_cmd_t *p_cmd, int i_query, va_list args, bool b_co
case ES_OUT_SET_JITTER: case ES_OUT_SET_JITTER:
{ {
mtime_t i_pts_delay = (mtime_t)va_arg( args, mtime_t ); mtime_t i_pts_delay = (mtime_t)va_arg( args, mtime_t );
mtime_t i_pts_jitter = (mtime_t)va_arg( args, mtime_t );
int i_cr_average = (int)va_arg( args, int ); int i_cr_average = (int)va_arg( args, int );
p_cmd->u.control.u.jitter.i_pts_delay = i_pts_delay; p_cmd->u.control.u.jitter.i_pts_delay = i_pts_delay;
p_cmd->u.control.u.jitter.i_pts_jitter = i_pts_jitter;
p_cmd->u.control.u.jitter.i_cr_average = i_cr_average; p_cmd->u.control.u.jitter.i_cr_average = i_cr_average;
break; break;
} }
...@@ -1498,6 +1501,7 @@ static int CmdExecuteControl( es_out_t *p_out, ts_cmd_t *p_cmd ) ...@@ -1498,6 +1501,7 @@ static int CmdExecuteControl( es_out_t *p_out, ts_cmd_t *p_cmd )
p_cmd->u.control.u.times.i_length ); p_cmd->u.control.u.times.i_length );
case ES_OUT_SET_JITTER: case ES_OUT_SET_JITTER:
return es_out_Control( p_out, i_query, p_cmd->u.control.u.jitter.i_pts_delay, return es_out_Control( p_out, i_query, p_cmd->u.control.u.jitter.i_pts_delay,
p_cmd->u.control.u.jitter.i_pts_jitter,
p_cmd->u.control.u.jitter.i_cr_average ); p_cmd->u.control.u.jitter.i_cr_average );
default: default:
......
...@@ -1142,7 +1142,7 @@ static void UpdatePtsDelay( input_thread_t *p_input ) ...@@ -1142,7 +1142,7 @@ static void UpdatePtsDelay( input_thread_t *p_input )
/* */ /* */
es_out_SetDelay( p_input->p->p_es_out_display, AUDIO_ES, i_audio_delay ); es_out_SetDelay( p_input->p->p_es_out_display, AUDIO_ES, i_audio_delay );
es_out_SetDelay( p_input->p->p_es_out_display, SPU_ES, i_spu_delay ); es_out_SetDelay( p_input->p->p_es_out_display, SPU_ES, i_spu_delay );
es_out_SetJitter( p_input->p->p_es_out, i_pts_delay, i_cr_average ); es_out_SetJitter( p_input->p->p_es_out, i_pts_delay, 0, i_cr_average );
} }
static void InitPrograms( input_thread_t * p_input ) static void InitPrograms( input_thread_t * p_input )
......
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