[vlc-devel] commit: audio filters can return NULL, handle it properly ( Rémi Denis-Courmont )

git version control git at videolan.org
Wed Sep 30 17:12:37 CEST 2009


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Wed Sep 30 18:10:55 2009 +0300| [a7c1a3ebf2310c66e9c7120c2869f3d69b245cdc] | committer: Rémi Denis-Courmont 

audio filters can return NULL, handle it properly

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=a7c1a3ebf2310c66e9c7120c2869f3d69b245cdc
---

 src/audio_output/input.c  |   12 ++++++++++--
 src/audio_output/output.c |    4 +++-
 2 files changed, 13 insertions(+), 3 deletions(-)

diff --git a/src/audio_output/input.c b/src/audio_output/input.c
index e34e66c..45aa96a 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 d8aca7f..dc6ea31 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;
     }
 




More information about the vlc-devel mailing list