Commit b5d7934f authored by Laurent Aimar's avatar Laurent Aimar

On pause and rate change from normal rate, call input_EsOutDiscontinuity

as soon as possible to allow decoders to flush (well that part need to
be implemented ;)
parent 8cfee3e8
......@@ -1549,7 +1549,6 @@ static vlc_bool_t Control( input_thread_t *p_input, int i_type,
/* Reset clock */
es_out_Control( p_input->p->p_es_out, ES_OUT_RESET_PCR );
input_EsOutDiscontinuity( p_input->p->p_es_out, VLC_FALSE );
}
else if( val.i_int == PAUSE_S && p_input->i_state == PLAYING_S &&
p_input->p->b_can_pause )
......@@ -1577,6 +1576,10 @@ static vlc_bool_t Control( input_thread_t *p_input, int i_type,
/* Switch to new state */
p_input->i_state = val.i_int;
var_Change( p_input, "state", VLC_VAR_SETVALUE, &val, NULL );
/* Send discontinuity to decoders (it will allow them to flush
* if implemented */
input_EsOutDiscontinuity( p_input->p->p_es_out, VLC_FALSE );
}
else if( val.i_int == PAUSE_S && !p_input->p->b_can_pause )
{
......@@ -1624,14 +1627,15 @@ static vlc_bool_t Control( input_thread_t *p_input, int i_type,
}
if( i_rate != p_input->p->i_rate )
{
p_input->p->i_rate = i_rate;
val.i_int = i_rate;
var_Change( p_input, "rate", VLC_VAR_SETVALUE, &val, NULL );
/* We haven't send data to decoder when rate != default */
if( i_rate == INPUT_RATE_DEFAULT )
/* We will not send audio data if new rate != default */
if( i_rate != INPUT_RATE_DEFAULT && p_input->p->i_rate == INPUT_RATE_DEFAULT )
input_EsOutDiscontinuity( p_input->p->p_es_out, VLC_TRUE );
p_input->p->i_rate = i_rate;
/* Reset clock */
es_out_Control( p_input->p->p_es_out, ES_OUT_RESET_PCR );
......
......@@ -245,7 +245,7 @@ void stream_AccessDelete( stream_t *s );
void stream_AccessReset( stream_t *s );
void stream_AccessUpdate( stream_t *s );
/* decoder.c FIXME make it public ?*/
/* decoder.c */
void input_DecoderDiscontinuity( decoder_t * p_dec );
vlc_bool_t input_DecoderEmpty( decoder_t * p_dec );
void input_DecoderPreroll( decoder_t *p_dec, int64_t i_preroll_end );
......
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