Commit 23298596 authored by Laurent Aimar's avatar Laurent Aimar

Fixed playing end of decoded audio data.

 It closes #4278, partially closes #3152, closes last part of #3090.
 It does not fix audio losses due to potentially buffered data by
packetizers/decoders.
parent 3fe5be16
......@@ -109,6 +109,7 @@ int aout_InputDelete( aout_instance_t * p_aout, aout_input_t * p_input );
int aout_InputPlay( aout_instance_t * p_aout, aout_input_t * p_input,
aout_buffer_t * p_buffer, int i_input_rate );
void aout_InputCheckAndRestart( aout_instance_t * p_aout, aout_input_t * p_input );
bool aout_InputIsEmpty( aout_instance_t * p_aout, aout_input_t * p_input );
/* From filters.c : */
int aout_FiltersCreatePipeline ( aout_instance_t * p_aout, filter_t ** pp_filters, int * pi_nb_filters, const audio_sample_format_t * p_input_format, const audio_sample_format_t * p_output_format );
......
......@@ -757,6 +757,14 @@ int aout_InputPlay( aout_instance_t * p_aout, aout_input_t * p_input,
return 0;
}
bool aout_InputIsEmpty( aout_instance_t * p_aout, aout_input_t * p_input )
{
aout_lock_input_fifos( p_aout );
bool is_empty = date_Get( &p_input->mixer.fifo.end_date ) <= mdate();
aout_unlock_input_fifos( p_aout );
return is_empty;
}
/*****************************************************************************
* static functions
*****************************************************************************/
......
......@@ -396,9 +396,11 @@ bool input_DecoderIsEmpty( decoder_t * p_dec )
if( b_empty )
{
vlc_mutex_lock( &p_owner->lock );
/* TODO audio support */
/* TODO subtitles support */
if( p_dec->fmt_out.i_cat == VIDEO_ES && p_owner->p_vout )
b_empty = vout_IsEmpty( p_owner->p_vout );
else if( p_dec->fmt_out.i_cat == AUDIO_ES && p_owner->p_aout && p_owner->p_aout_input )
b_empty = aout_InputIsEmpty( p_owner->p_aout, p_owner->p_aout_input );
vlc_mutex_unlock( &p_owner->lock );
}
return b_empty;
......
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