[vlc-commits] commit: Fixed playing end of decoded audio data. (Laurent Aimar )
git at videolan.org
git at videolan.org
Sat Oct 30 16:46:12 CEST 2010
vlc | branch: master | Laurent Aimar <fenrir at videolan.org> | Sat Oct 30 00:57:01 2010 +0200| [2329859614c05d33ace52b0a3ccda9fc2af926a0] | committer: 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.
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=2329859614c05d33ace52b0a3ccda9fc2af926a0
---
src/audio_output/aout_internal.h | 1 +
src/audio_output/input.c | 8 ++++++++
src/input/decoder.c | 4 +++-
3 files changed, 12 insertions(+), 1 deletions(-)
diff --git a/src/audio_output/aout_internal.h b/src/audio_output/aout_internal.h
index 0d9da2a..b4b7437 100644
--- a/src/audio_output/aout_internal.h
+++ b/src/audio_output/aout_internal.h
@@ -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 );
diff --git a/src/audio_output/input.c b/src/audio_output/input.c
index d237466..8fcd834 100644
--- a/src/audio_output/input.c
+++ b/src/audio_output/input.c
@@ -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
*****************************************************************************/
diff --git a/src/input/decoder.c b/src/input/decoder.c
index f7ec650..018b24c 100644
--- a/src/input/decoder.c
+++ b/src/input/decoder.c
@@ -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;
More information about the vlc-commits
mailing list