Commit fe805f7b authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

aout: remove input.b_paused (use VLC_TS_INVALID pause date)

parent c81a6fdd
......@@ -85,7 +85,6 @@ struct aout_input_t
int i_buffer_lost;
/* */
bool b_paused;
mtime_t i_pause_date;
/* */
......
......@@ -82,8 +82,7 @@ aout_input_t *aout_DecNew( audio_output_t *p_aout,
return NULL;
p_input->b_error = true;
p_input->b_paused = false;
p_input->i_pause_date = 0;
p_input->i_pause_date = VLC_TS_INVALID;
aout_FormatPrepare( p_format );
......@@ -223,23 +222,23 @@ int aout_DecGetResetLost( audio_output_t *p_aout, aout_input_t *p_input )
void aout_DecChangePause( audio_output_t *p_aout, aout_input_t *p_input, bool b_paused, mtime_t i_date )
{
mtime_t i_duration = 0;
aout_lock( p_aout );
assert( p_aout->p_input == p_input );
assert( !p_input->b_paused || !b_paused );
if( p_input->b_paused )
if( b_paused )
{
i_duration = i_date - p_input->i_pause_date;
p_input->i_pause_date = i_date;
}
p_input->b_paused = b_paused;
p_input->i_pause_date = i_date;
if( i_duration != 0 )
else
{
assert( p_input->i_pause_date != VLC_TS_INVALID );
mtime_t i_duration = i_date - p_input->i_pause_date;
p_input->i_pause_date = VLC_TS_INVALID;
aout_FifoMoveDates( &p_input->fifo, i_duration );
aout_FifoMoveDates( &p_aout->fifo, i_duration );
}
aout_OutputPause( p_aout, b_paused, i_date );
aout_unlock( p_aout );
}
......
......@@ -466,7 +466,6 @@ void aout_InputCheckAndRestart( audio_output_t * p_aout, aout_input_t * p_input
/* A little trick to avoid loosing our input fifo and properties */
aout_fifo_t fifo = p_input->fifo;
bool b_paused = p_input->b_paused;
mtime_t i_pause_date = p_input->i_pause_date;
aout_FifoInit( p_aout, &p_input->fifo, p_aout->mixer_format.i_rate );
......@@ -475,7 +474,6 @@ void aout_InputCheckAndRestart( audio_output_t * p_aout, aout_input_t * p_input
aout_InputNew( p_aout, p_input, &p_input->request_vout );
p_input->fifo = fifo;
p_input->b_paused = b_paused;
p_input->i_pause_date = i_pause_date;
p_input->b_restart = false;
......
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