[vlc-commits] aout_Filters*Pipeline: remove useless parameter, constify
Rémi Denis-Courmont
git at videolan.org
Tue May 31 17:36:01 CEST 2011
vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Tue May 31 17:36:35 2011 +0300| [6400a0047f2d092ed531bbf7d1cfa603d6fa065c] | committer: Rémi Denis-Courmont
aout_Filters*Pipeline: remove useless parameter, constify
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=6400a0047f2d092ed531bbf7d1cfa603d6fa065c
---
src/audio_output/aout_internal.h | 4 ++--
src/audio_output/filters.c | 26 ++++++++++----------------
src/audio_output/input.c | 10 ++++------
src/audio_output/output.c | 2 +-
4 files changed, 17 insertions(+), 25 deletions(-)
diff --git a/src/audio_output/aout_internal.h b/src/audio_output/aout_internal.h
index 4066cfd..ed9f52b 100644
--- a/src/audio_output/aout_internal.h
+++ b/src/audio_output/aout_internal.h
@@ -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 );
diff --git a/src/audio_output/filters.c b/src/audio_output/filters.c
index 4067d89..3340a4e 100644
--- a/src/audio_output/filters.c
+++ b/src/audio_output/filters.c
@@ -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;
}
-
diff --git a/src/audio_output/input.c b/src/audio_output/input.c
index 9fa526c..466431c 100644
--- a/src/audio_output/input.c
+++ b/src/audio_output/input.c
@@ -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" );
diff --git a/src/audio_output/output.c b/src/audio_output/output.c
index 6fe20e2..2f4397b 100644
--- a/src/audio_output/output.c
+++ b/src/audio_output/output.c
@@ -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 );
More information about the vlc-commits
mailing list