aout_Filters*Pipeline: remove useless parameter, constify
authorRémi Denis-Courmont <remi@remlab.net>
Tue, 31 May 2011 14:36:35 +0000 (17:36 +0300)
committerRémi Denis-Courmont <remi@remlab.net>
Tue, 31 May 2011 15:19:54 +0000 (18:19 +0300)
src/audio_output/aout_internal.h
src/audio_output/filters.c
src/audio_output/input.c
src/audio_output/output.c

index 4066cfd..ed9f52b 100644 (file)
@@ -104,8 +104,8 @@ 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 );
-void aout_FiltersDestroyPipeline ( aout_instance_t * p_aout, filter_t ** pp_filters, int i_nb_filters );
-void  aout_FiltersPlay ( filter_t ** pp_filters, unsigned i_nb_filters, aout_buffer_t ** pp_input_buffer );
+void aout_FiltersDestroyPipeline( filter_t *const *, unsigned );
+void aout_FiltersPlay( filter_t *const *, unsigned, aout_buffer_t ** );
 
 /* From mixer.c : */
 int aout_MixerNew( aout_instance_t * p_aout );
index 4067d89..3340a4e 100644 (file)
@@ -273,19 +273,14 @@ int aout_FiltersCreatePipeline( aout_instance_t * p_aout,
     return 0;
 }
 
-/*****************************************************************************
- * aout_FiltersDestroyPipeline: deallocate a filters pipeline
- *****************************************************************************/
-void aout_FiltersDestroyPipeline( aout_instance_t * p_aout,
-                                  filter_t ** pp_filters,
-                                  int i_nb_filters )
+/**
+ * Destroys a chain of audio filters.
+ */
+void aout_FiltersDestroyPipeline( filter_t *const *filters, unsigned n )
 {
-    int i;
-    (void)p_aout;
-
-    for ( i = 0; i < i_nb_filters; i++ )
+    for( unsigned i = 0; i < n; i++ )
     {
-        filter_t *p_filter = pp_filters[i];
+        filter_t *p_filter = filters[i];
 
         module_unneed( p_filter, p_filter->p_module );
         free( p_filter->p_owner );
@@ -293,10 +288,10 @@ void aout_FiltersDestroyPipeline( aout_instance_t * p_aout,
     }
 }
 
-/*****************************************************************************
- * aout_FiltersPlay: play a buffer
- *****************************************************************************/
-void aout_FiltersPlay( filter_t *pp_filters,
+/**
+ * Filters an audio buffer through a chain of filters.
+ */
+void aout_FiltersPlay( filter_t *const *pp_filters,
                        unsigned i_nb_filters, block_t ** pp_block )
 {
     block_t *p_block = *pp_block;
@@ -312,4 +307,3 @@ void aout_FiltersPlay( filter_t ** pp_filters,
     }
     *pp_block = p_block;
 }
-
index 9fa526c..466431c 100644 (file)
@@ -451,10 +451,9 @@ int aout_InputDelete( aout_instance_t * p_aout, aout_input_t * p_input )
     p_input->b_recycle_vout = psz_visual && *psz_visual;
     free( psz_visual );
 
-    aout_FiltersDestroyPipeline( p_aout, p_input->pp_filters,
-                                 p_input->i_nb_filters );
+    aout_FiltersDestroyPipeline( p_input->pp_filters, p_input->i_nb_filters );
     p_input->i_nb_filters = 0;
-    aout_FiltersDestroyPipeline( p_aout, p_input->pp_resamplers,
+    aout_FiltersDestroyPipeline( p_input->pp_resamplers,
                                  p_input->i_nb_resamplers );
     p_input->i_nb_resamplers = 0;
     aout_FifoDestroy( p_aout, &p_input->mixer.fifo );
@@ -753,9 +752,8 @@ static void inputFailure( aout_instance_t * p_aout, aout_input_t * p_input,
     msg_Err( p_aout, "%s", psz_error_message );
 
     /* clean up */
-    aout_FiltersDestroyPipeline( p_aout, p_input->pp_filters,
-                                 p_input->i_nb_filters );
-    aout_FiltersDestroyPipeline( p_aout, p_input->pp_resamplers,
+    aout_FiltersDestroyPipeline( p_input->pp_filters, p_input->i_nb_filters );
+    aout_FiltersDestroyPipeline( p_input->pp_resamplers,
                                  p_input->i_nb_resamplers );
     aout_FifoDestroy( p_aout, &p_input->mixer.fifo );
     var_Destroy( p_aout, "visual" );
index 6fe20e2..2f4397b 100644 (file)
@@ -211,7 +211,7 @@ void aout_OutputDelete( aout_instance_t * p_aout )
     module_unneed( p_aout, p_aout->output.p_module );
     p_aout->output.p_module = NULL;
 
-    aout_FiltersDestroyPipeline( p_aout, p_aout->output.pp_filters,
+    aout_FiltersDestroyPipeline( p_aout->output.pp_filters,
                                  p_aout->output.i_nb_filters );
 
     aout_lock_output_fifo( p_aout );