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

aout: only (directly) access output FIFO from output functions

parent fe805f7b
...@@ -225,6 +225,8 @@ void aout_DecChangePause( audio_output_t *p_aout, aout_input_t *p_input, bool b_ ...@@ -225,6 +225,8 @@ void aout_DecChangePause( audio_output_t *p_aout, aout_input_t *p_input, bool b_
aout_lock( p_aout ); aout_lock( p_aout );
assert( p_aout->p_input == p_input ); assert( p_aout->p_input == p_input );
aout_OutputPause( p_aout, b_paused, i_date );
if( b_paused ) if( b_paused )
{ {
p_input->i_pause_date = i_date; p_input->i_pause_date = i_date;
...@@ -236,10 +238,7 @@ void aout_DecChangePause( audio_output_t *p_aout, aout_input_t *p_input, bool b_ ...@@ -236,10 +238,7 @@ void aout_DecChangePause( audio_output_t *p_aout, aout_input_t *p_input, bool b_
mtime_t i_duration = i_date - p_input->i_pause_date; mtime_t i_duration = i_date - p_input->i_pause_date;
p_input->i_pause_date = VLC_TS_INVALID; p_input->i_pause_date = VLC_TS_INVALID;
aout_FifoMoveDates( &p_input->fifo, i_duration ); 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 ); aout_unlock( p_aout );
} }
...@@ -247,7 +246,6 @@ void aout_DecFlush( audio_output_t *p_aout, aout_input_t *p_input ) ...@@ -247,7 +246,6 @@ void aout_DecFlush( audio_output_t *p_aout, aout_input_t *p_input )
{ {
aout_lock( p_aout ); aout_lock( p_aout );
aout_FifoReset( &p_input->fifo ); aout_FifoReset( &p_input->fifo );
aout_FifoReset( &p_aout->fifo );
aout_OutputFlush( p_aout, false ); aout_OutputFlush( p_aout, false );
aout_unlock( p_aout ); aout_unlock( p_aout );
} }
......
...@@ -548,7 +548,7 @@ void aout_InputPlay( audio_output_t * p_aout, aout_input_t * p_input, ...@@ -548,7 +548,7 @@ void aout_InputPlay( audio_output_t * p_aout, aout_input_t * p_input,
msg_Warn( p_aout, "computed PTS is out of range (%"PRId64"), " msg_Warn( p_aout, "computed PTS is out of range (%"PRId64"), "
"clearing out", now - start_date ); "clearing out", now - start_date );
aout_FifoReset( &p_input->fifo ); aout_FifoReset( &p_input->fifo );
aout_FifoReset( &p_aout->fifo ); aout_OutputFlush( p_aout, false );
if ( p_input->i_resampling_type != AOUT_RESAMPLING_NONE ) if ( p_input->i_resampling_type != AOUT_RESAMPLING_NONE )
msg_Warn( p_aout, "timing screwed, stopping resampling" ); msg_Warn( p_aout, "timing screwed, stopping resampling" );
inputResamplingStop( p_input ); inputResamplingStop( p_input );
...@@ -579,7 +579,7 @@ void aout_InputPlay( audio_output_t * p_aout, aout_input_t * p_input, ...@@ -579,7 +579,7 @@ void aout_InputPlay( audio_output_t * p_aout, aout_input_t * p_input,
msg_Warn( p_aout, "buffer way too early (%"PRId64"), clearing queue", msg_Warn( p_aout, "buffer way too early (%"PRId64"), clearing queue",
drift ); drift );
aout_FifoReset( &p_input->fifo ); aout_FifoReset( &p_input->fifo );
aout_FifoReset( &p_aout->fifo ); aout_OutputFlush( p_aout, false );
if ( p_input->i_resampling_type != AOUT_RESAMPLING_NONE ) if ( p_input->i_resampling_type != AOUT_RESAMPLING_NONE )
msg_Warn( p_aout, "timing screwed, stopping resampling" ); msg_Warn( p_aout, "timing screwed, stopping resampling" );
inputResamplingStop( p_input ); inputResamplingStop( p_input );
......
...@@ -250,6 +250,12 @@ void aout_OutputPause( audio_output_t *aout, bool pause, mtime_t date ) ...@@ -250,6 +250,12 @@ void aout_OutputPause( audio_output_t *aout, bool pause, mtime_t date )
if( aout->pf_pause != NULL ) if( aout->pf_pause != NULL )
aout->pf_pause( aout, pause, date ); aout->pf_pause( aout, pause, date );
if( !pause )
{
mtime_t duration = date - aout->p_input->i_pause_date;
/* XXX: ^ onk onk! gruik! ^ */
aout_FifoMoveDates( &aout->fifo, duration );
}
} }
/** /**
...@@ -264,6 +270,7 @@ void aout_OutputFlush( audio_output_t *aout, bool wait ) ...@@ -264,6 +270,7 @@ void aout_OutputFlush( audio_output_t *aout, bool wait )
if( aout->pf_flush != NULL ) if( aout->pf_flush != NULL )
aout->pf_flush( aout, wait ); aout->pf_flush( aout, wait );
aout_FifoReset( &aout->fifo );
} }
......
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