Commit 4551fb33 authored by Laurent Aimar's avatar Laurent Aimar

Clean up/Factorize.

parent cc61952d
...@@ -302,7 +302,7 @@ es_out_id_t *input_EsOutGetFromID( es_out_t *out, int i_id ) ...@@ -302,7 +302,7 @@ es_out_id_t *input_EsOutGetFromID( es_out_t *out, int i_id )
return NULL; return NULL;
} }
void input_EsOutDiscontinuity( es_out_t *out, vlc_bool_t b_flush, vlc_bool_t b_audio ) static void EsOutDiscontinuity( es_out_t *out, vlc_bool_t b_flush, vlc_bool_t b_audio )
{ {
es_out_sys_t *p_sys = out->p_sys; es_out_sys_t *p_sys = out->p_sys;
int i; int i;
...@@ -322,7 +322,7 @@ void input_EsOutChangeRate( es_out_t *out ) ...@@ -322,7 +322,7 @@ void input_EsOutChangeRate( es_out_t *out )
es_out_sys_t *p_sys = out->p_sys; es_out_sys_t *p_sys = out->p_sys;
int i; int i;
input_EsOutDiscontinuity( out, VLC_FALSE, VLC_FALSE ); EsOutDiscontinuity( out, VLC_FALSE, VLC_FALSE );
for( i = 0; i < p_sys->i_pgrm; i++ ) for( i = 0; i < p_sys->i_pgrm; i++ )
input_ClockSetRate( p_sys->p_input, &p_sys->pgrm[i]->clock ); input_ClockSetRate( p_sys->p_input, &p_sys->pgrm[i]->clock );
...@@ -346,7 +346,7 @@ void input_EsOutChangeState( es_out_t *out ) ...@@ -346,7 +346,7 @@ void input_EsOutChangeState( es_out_t *out )
{ {
/* Send discontinuity to decoders (it will allow them to flush /* Send discontinuity to decoders (it will allow them to flush
* * if implemented */ * * if implemented */
input_EsOutDiscontinuity( out, VLC_FALSE, VLC_FALSE ); EsOutDiscontinuity( out, VLC_FALSE, VLC_FALSE );
} }
else else
{ {
...@@ -354,6 +354,13 @@ void input_EsOutChangeState( es_out_t *out ) ...@@ -354,6 +354,13 @@ void input_EsOutChangeState( es_out_t *out )
es_out_Control( out, ES_OUT_RESET_PCR ); es_out_Control( out, ES_OUT_RESET_PCR );
} }
} }
void input_EsOutChangePosition( es_out_t *out )
{
//es_out_sys_t *p_sys = out->p_sys;
es_out_Control( out, ES_OUT_RESET_PCR );
EsOutDiscontinuity( out, VLC_TRUE, VLC_FALSE );
}
vlc_bool_t input_EsOutDecodersEmpty( es_out_t *out ) vlc_bool_t input_EsOutDecodersEmpty( es_out_t *out )
{ {
......
...@@ -1519,8 +1519,7 @@ static vlc_bool_t Control( input_thread_t *p_input, int i_type, ...@@ -1519,8 +1519,7 @@ static vlc_bool_t Control( input_thread_t *p_input, int i_type,
if( f_pos < 0.0 ) f_pos = 0.0; if( f_pos < 0.0 ) f_pos = 0.0;
if( f_pos > 1.0 ) f_pos = 1.0; if( f_pos > 1.0 ) f_pos = 1.0;
/* Reset the decoders states and clock sync (before calling the demuxer */ /* Reset the decoders states and clock sync (before calling the demuxer */
es_out_Control( p_input->p->p_es_out, ES_OUT_RESET_PCR ); input_EsOutChangePosition( p_input->p->p_es_out );
input_EsOutDiscontinuity( p_input->p->p_es_out, VLC_TRUE, VLC_FALSE );
if( demux2_Control( p_input->p->input.p_demux, DEMUX_SET_POSITION, if( demux2_Control( p_input->p->input.p_demux, DEMUX_SET_POSITION,
f_pos ) ) f_pos ) )
{ {
...@@ -1557,8 +1556,7 @@ static vlc_bool_t Control( input_thread_t *p_input, int i_type, ...@@ -1557,8 +1556,7 @@ static vlc_bool_t Control( input_thread_t *p_input, int i_type,
if( i_time < 0 ) i_time = 0; if( i_time < 0 ) i_time = 0;
/* Reset the decoders states and clock sync (before calling the demuxer */ /* Reset the decoders states and clock sync (before calling the demuxer */
es_out_Control( p_input->p->p_es_out, ES_OUT_RESET_PCR ); input_EsOutChangePosition( p_input->p->p_es_out );
input_EsOutDiscontinuity( p_input->p->p_es_out, VLC_TRUE, VLC_FALSE );
i_ret = demux2_Control( p_input->p->input.p_demux, i_ret = demux2_Control( p_input->p->input.p_demux,
DEMUX_SET_TIME, i_time ); DEMUX_SET_TIME, i_time );
...@@ -1760,8 +1758,7 @@ static vlc_bool_t Control( input_thread_t *p_input, int i_type, ...@@ -1760,8 +1758,7 @@ static vlc_bool_t Control( input_thread_t *p_input, int i_type,
if( i_title >= 0 && i_title < p_input->p->input.i_title ) if( i_title >= 0 && i_title < p_input->p->input.i_title )
{ {
es_out_Control( p_input->p->p_es_out, ES_OUT_RESET_PCR ); input_EsOutChangePosition( p_input->p->p_es_out );
input_EsOutDiscontinuity( p_input->p->p_es_out, VLC_TRUE, VLC_FALSE );
demux2_Control( p_demux, DEMUX_SET_TITLE, i_title ); demux2_Control( p_demux, DEMUX_SET_TITLE, i_title );
input_ControlVarTitle( p_input, i_title ); input_ControlVarTitle( p_input, i_title );
...@@ -1781,8 +1778,7 @@ static vlc_bool_t Control( input_thread_t *p_input, int i_type, ...@@ -1781,8 +1778,7 @@ static vlc_bool_t Control( input_thread_t *p_input, int i_type,
if( i_title >= 0 && i_title < p_input->p->input.i_title ) if( i_title >= 0 && i_title < p_input->p->input.i_title )
{ {
es_out_Control( p_input->p->p_es_out, ES_OUT_RESET_PCR ); input_EsOutChangePosition( p_input->p->p_es_out );
input_EsOutDiscontinuity( p_input->p->p_es_out, VLC_TRUE, VLC_FALSE );
access2_Control( p_access, ACCESS_SET_TITLE, i_title ); access2_Control( p_access, ACCESS_SET_TITLE, i_title );
stream_AccessReset( p_input->p->input.p_stream ); stream_AccessReset( p_input->p->input.p_stream );
...@@ -1822,8 +1818,8 @@ static vlc_bool_t Control( input_thread_t *p_input, int i_type, ...@@ -1822,8 +1818,8 @@ static vlc_bool_t Control( input_thread_t *p_input, int i_type,
if( i_seekpoint >= 0 && i_seekpoint < if( i_seekpoint >= 0 && i_seekpoint <
p_input->p->input.title[p_demux->info.i_title]->i_seekpoint ) p_input->p->input.title[p_demux->info.i_title]->i_seekpoint )
{ {
es_out_Control( p_input->p->p_es_out, ES_OUT_RESET_PCR );
input_EsOutDiscontinuity( p_input->p->p_es_out, VLC_TRUE, VLC_FALSE ); input_EsOutChangePosition( p_input->p->p_es_out );
demux2_Control( p_demux, DEMUX_SET_SEEKPOINT, i_seekpoint ); demux2_Control( p_demux, DEMUX_SET_SEEKPOINT, i_seekpoint );
} }
...@@ -1858,8 +1854,7 @@ static vlc_bool_t Control( input_thread_t *p_input, int i_type, ...@@ -1858,8 +1854,7 @@ static vlc_bool_t Control( input_thread_t *p_input, int i_type,
if( i_seekpoint >= 0 && i_seekpoint < if( i_seekpoint >= 0 && i_seekpoint <
p_input->p->input.title[p_access->info.i_title]->i_seekpoint ) p_input->p->input.title[p_access->info.i_title]->i_seekpoint )
{ {
es_out_Control( p_input->p->p_es_out, ES_OUT_RESET_PCR ); input_EsOutChangePosition( p_input->p->p_es_out );
input_EsOutDiscontinuity( p_input->p->p_es_out, VLC_TRUE, VLC_FALSE );
access2_Control( p_access, ACCESS_SET_SEEKPOINT, access2_Control( p_access, ACCESS_SET_SEEKPOINT,
i_seekpoint ); i_seekpoint );
......
...@@ -264,10 +264,10 @@ vlc_bool_t input_DecoderEmpty( decoder_t * p_dec ); ...@@ -264,10 +264,10 @@ vlc_bool_t input_DecoderEmpty( decoder_t * p_dec );
es_out_t *input_EsOutNew( input_thread_t * ); es_out_t *input_EsOutNew( input_thread_t * );
void input_EsOutDelete( es_out_t * ); void input_EsOutDelete( es_out_t * );
es_out_id_t *input_EsOutGetFromID( es_out_t *, int i_id ); es_out_id_t *input_EsOutGetFromID( es_out_t *, int i_id );
void input_EsOutDiscontinuity( es_out_t *, vlc_bool_t b_flush, vlc_bool_t b_audio );
void input_EsOutSetDelay( es_out_t *, int i_cat, int64_t ); void input_EsOutSetDelay( es_out_t *, int i_cat, int64_t );
void input_EsOutChangeRate( es_out_t * ); void input_EsOutChangeRate( es_out_t * );
void input_EsOutChangeState( es_out_t * ); void input_EsOutChangeState( es_out_t * );
void input_EsOutChangePosition( es_out_t * );
vlc_bool_t input_EsOutDecodersEmpty( es_out_t * ); vlc_bool_t input_EsOutDecodersEmpty( es_out_t * );
/* clock.c */ /* clock.c */
......
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