From: RĂ©mi Denis-Courmont Date: Wed, 30 Sep 2009 15:10:55 +0000 (+0300) Subject: audio filters can return NULL, handle it properly X-Git-Tag: 1.1.0-ff~3119 X-Git-Url: https://git.sesse.net/?a=commitdiff_plain;h=a7c1a3ebf2310c66e9c7120c2869f3d69b245cdc;p=vlc audio filters can return NULL, handle it properly --- diff --git a/src/audio_output/input.c b/src/audio_output/input.c index e34e66c73f..45aa96a5a8 100644 --- a/src/audio_output/input.c +++ b/src/audio_output/input.c @@ -546,6 +546,8 @@ int aout_InputPlay( aout_instance_t * p_aout, aout_input_t * p_input, /* Run pre-filters. */ aout_FiltersPlay( p_aout, p_input->pp_filters, p_input->i_nb_filters, &p_buffer ); + if( !p_buffer ) + return 0; /* Actually run the resampler now. */ if ( p_input->i_nb_resamplers > 0 ) @@ -556,9 +558,11 @@ int aout_InputPlay( aout_instance_t * p_aout, aout_input_t * p_input, &p_buffer ); } + if( !p_buffer ) + return 0; if( p_buffer->i_nb_samples <= 0 ) { - aout_BufferFree( p_buffer ); + block_Release( p_buffer ); return 0; } #endif @@ -643,6 +647,8 @@ int aout_InputPlay( aout_instance_t * p_aout, aout_input_t * p_input, #ifndef AOUT_PROCESS_BEFORE_CHEKS /* Run pre-filters. */ aout_FiltersPlay( p_input->pp_filters, p_input->i_nb_filters, &p_buffer ); + if( !p_buffer ) + return 0; #endif /* Run the resampler if needed. @@ -735,9 +741,11 @@ int aout_InputPlay( aout_instance_t * p_aout, aout_input_t * p_input, &p_buffer ); } + if( !p_buffer ) + return 0; if( p_buffer->i_nb_samples <= 0 ) { - aout_BufferFree( p_buffer ); + block_Release( p_buffer ); return 0; } #endif diff --git a/src/audio_output/output.c b/src/audio_output/output.c index d8aca7f377..dc6ea31e71 100644 --- a/src/audio_output/output.c +++ b/src/audio_output/output.c @@ -249,9 +249,11 @@ void aout_OutputPlay( aout_instance_t * p_aout, aout_buffer_t * p_buffer ) aout_FiltersPlay( p_aout->output.pp_filters, p_aout->output.i_nb_filters, &p_buffer ); + if( !p_buffer ) + return; if( p_buffer->i_buffer == 0 ) { - aout_BufferFree( p_buffer ); + block_Release( p_buffer ); return; }