int aout_DecPlay( aout_instance_t *, aout_input_t *, aout_buffer_t *, int i_input_rate );
int aout_DecGetResetLost( aout_instance_t *, aout_input_t * );
void aout_DecChangePause( aout_instance_t *, aout_input_t *, bool b_paused, mtime_t i_date );
+void aout_DecFlush( aout_instance_t *, aout_input_t * );
/* Helpers */
}
}
+void aout_DecFlush( aout_instance_t *p_aout, aout_input_t *p_input )
+{
+ aout_lock_input_fifos( p_aout );
+
+ aout_FifoSet( p_aout, &p_input->fifo, 0 );
+ p_input->p_first_byte_to_mix = NULL;
+
+ aout_unlock_input_fifos( p_aout );
+}
+
}
vlc_mutex_unlock( &p_owner->lock );
- /* Make sure the thread leaves the function by
- * sending it an empty block. */
- block_t *p_block = block_New( p_dec, 0 );
- input_DecoderDecode( p_dec, p_block );
+ /* Make sure the thread leaves the function */
+ block_FifoWake( p_owner->p_fifo );
vlc_thread_join( p_dec );
while( vlc_object_alive( p_dec ) && !p_dec->b_error )
{
if( ( p_block = block_FifoGet( p_owner->p_fifo ) ) == NULL )
- {
- p_dec->b_error = true;
- break;
- }
+ continue;
if( DecoderProcess( p_dec, p_block ) != VLC_SUCCESS )
break;
if( p_owner->i_preroll_end > 0 )
{
- /* FIXME TODO flush audio output (don't know how to do that) */
msg_Dbg( p_dec, "End of audio preroll" );
+ if( p_owner->p_aout && p_owner->p_aout_input )
+ aout_DecFlush( p_owner->p_aout, p_owner->p_aout_input );
+ /* */
p_owner->i_preroll_end = -1;
}
{
decoder_owner_sys_t *p_owner = (decoder_owner_sys_t *)p_dec->p_owner;
- if( b_flush && p_owner->p_aout && p_owner->p_aout_input )
- {
- // TODO flush
- }
-
if( p_owner->p_packetizer )
{
block_t *p_packetized_block;
{
DecoderDecodeAudio( p_dec, p_block );
}
+
+ if( b_flush && p_owner->p_aout && p_owner->p_aout_input )
+ aout_DecFlush( p_owner->p_aout, p_owner->p_aout_input );
}
/* This function process a subtitle block