[vlc-commits] Remove filter_t.pf_audio_buffer_new

Rémi Denis-Courmont git at videolan.org
Mon Sep 5 21:55:00 CEST 2011


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Mon Sep  5 22:39:19 2011 +0300| [cece0cc75448b1a6b19991b6afc0ed356ba4d8d2] | committer: Rémi Denis-Courmont

Remove filter_t.pf_audio_buffer_new

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

 include/vlc_filter.h                           |   20 +-------------------
 modules/audio_filter/channel_mixer/mono.c      |    2 +-
 modules/audio_filter/converter/dtstofloat32.c  |    2 +-
 modules/audio_filter/converter/mpgatofixed32.c |    2 +-
 modules/stream_out/transcode/audio.c           |    8 +-------
 src/audio_output/aout_internal.h               |    2 --
 src/audio_output/filters.c                     |    7 -------
 src/audio_output/input.c                       |    1 -
 8 files changed, 5 insertions(+), 39 deletions(-)

diff --git a/include/vlc_filter.h b/include/vlc_filter.h
index c2ec30f..1c2882c 100644
--- a/include/vlc_filter.h
+++ b/include/vlc_filter.h
@@ -89,10 +89,8 @@ struct filter_t
         struct
         {
             block_t *   (*pf_filter) ( filter_t *, block_t * );
-            block_t *   (*pf_buffer_new) ( filter_t *, int );
         } audio;
 #define pf_audio_filter     u.audio.pf_filter
-#define pf_audio_buffer_new u.audio.pf_buffer_new
 
         struct
         {
@@ -211,23 +209,7 @@ static inline void filter_DeleteSubpicture( filter_t *p_filter, subpicture_t *p_
     p_filter->pf_sub_buffer_del( p_filter, p_subpicture );
 }
 
-/**
- * This function will return a new audio buffer usable by p_filter as an
- * output buffer. You have to release it using block_Release or by returning
- * it to the caller as a pf_audio_filter return value.
- * Provided for convenience.
- *
- * \param p_filter filter_t object
- * \param i_size size of audio buffer requested
- * \return block to be used as audio output buffer
- */
-static inline block_t *filter_NewAudioBuffer( filter_t *p_filter, int i_size )
-{
-    block_t *p_block = p_filter->pf_audio_buffer_new( p_filter, i_size );
-    if( !p_block )
-        msg_Warn( p_filter, "can't get output block" );
-    return p_block;
-}
+#define filter_NewAudioBuffer block_New
 
 /**
  * This function gives all input attachments at once.
diff --git a/modules/audio_filter/channel_mixer/mono.c b/modules/audio_filter/channel_mixer/mono.c
index 5a630f9..dd5a0e3 100644
--- a/modules/audio_filter/channel_mixer/mono.c
+++ b/modules/audio_filter/channel_mixer/mono.c
@@ -466,7 +466,7 @@ static block_t *Convert( filter_t *p_filter, block_t *p_block )
     i_out_size = p_block->i_nb_samples * p_filter->p_sys->i_bitspersample/8 *
                  aout_FormatNbChannels( &(p_filter->fmt_out.audio) );
 
-    p_out = p_filter->pf_audio_buffer_new( p_filter, i_out_size );
+    p_out = block_Alloc( i_out_size );
     if( !p_out )
     {
         msg_Warn( p_filter, "can't get output buffer" );
diff --git a/modules/audio_filter/converter/dtstofloat32.c b/modules/audio_filter/converter/dtstofloat32.c
index 50de2b2..056accc 100644
--- a/modules/audio_filter/converter/dtstofloat32.c
+++ b/modules/audio_filter/converter/dtstofloat32.c
@@ -369,7 +369,7 @@ static block_t *Convert( filter_t *p_filter, block_t *p_block )
       p_filter->fmt_out.audio.i_bitspersample *
         p_filter->fmt_out.audio.i_channels / 8;
 
-    block_t *p_out = p_filter->pf_audio_buffer_new( p_filter, i_out_size );
+    block_t *p_out = block_Alloc( i_out_size );
     if( !p_out )
     {
         msg_Warn( p_filter, "can't get output buffer" );
diff --git a/modules/audio_filter/converter/mpgatofixed32.c b/modules/audio_filter/converter/mpgatofixed32.c
index d77d689..8a44a14 100644
--- a/modules/audio_filter/converter/mpgatofixed32.c
+++ b/modules/audio_filter/converter/mpgatofixed32.c
@@ -236,7 +236,7 @@ static block_t *Convert( filter_t *p_filter, block_t *p_block )
       p_filter->fmt_out.audio.i_bitspersample *
         p_filter->fmt_out.audio.i_channels / 8;
 
-    block_t *p_out = p_filter->pf_audio_buffer_new( p_filter, i_out_size );
+    block_t *p_out = block_Alloc( i_out_size );
     if( !p_out )
     {
         msg_Warn( p_filter, "can't get output buffer" );
diff --git a/modules/stream_out/transcode/audio.c b/modules/stream_out/transcode/audio.c
index ddc419f..55ce312 100644
--- a/modules/stream_out/transcode/audio.c
+++ b/modules/stream_out/transcode/audio.c
@@ -62,12 +62,6 @@ static inline void audio_timer_close( encoder_t * p_encoder )
     stats_TimerClean( p_encoder, STATS_TIMER_AUDIO_FRAME_ENCODING );
 }
 
-static block_t *transcode_audio_alloc( filter_t *p_filter, int size )
-{
-    VLC_UNUSED( p_filter );
-    return block_Alloc( size );
-}
-
 static aout_buffer_t *audio_new_buffer( decoder_t *p_dec, int i_samples )
 {
     block_t *p_block;
@@ -97,8 +91,8 @@ static aout_buffer_t *audio_new_buffer( decoder_t *p_dec, int i_samples )
 static int transcode_audio_filter_allocation_init( filter_t *p_filter,
                                                    void *data )
 {
+    VLC_UNUSED(p_filter);
     VLC_UNUSED(data);
-    p_filter->pf_audio_buffer_new = transcode_audio_alloc;
     return VLC_SUCCESS;
 }
 
diff --git a/src/audio_output/aout_internal.h b/src/audio_output/aout_internal.h
index 928aa39..f8ebd79 100644
--- a/src/audio_output/aout_internal.h
+++ b/src/audio_output/aout_internal.h
@@ -46,8 +46,6 @@ struct filter_owner_sys_t
     aout_input_t    *p_input;
 };
 
-block_t *aout_FilterBufferNew( filter_t *, int );
-
 /** an input stream for the audio output */
 struct aout_input_t
 {
diff --git a/src/audio_output/filters.c b/src/audio_output/filters.c
index bd80e22..b41dc55 100644
--- a/src/audio_output/filters.c
+++ b/src/audio_output/filters.c
@@ -40,12 +40,6 @@
 #include "aout_internal.h"
 #include <libvlc.h>
 
-block_t *aout_FilterBufferNew( filter_t *p_filter, int size )
-{
-    (void) p_filter;
-    return block_Alloc( size );
-}
-
 /*****************************************************************************
  * FindFilter: find an audio filter for a specific transformation
  *****************************************************************************/
@@ -66,7 +60,6 @@ static filter_t * FindFilter( vlc_object_t *obj,
     memcpy( &p_filter->fmt_out.audio, p_output_format,
             sizeof(audio_sample_format_t) );
     p_filter->fmt_out.i_codec = p_output_format->i_format;
-    p_filter->pf_audio_buffer_new = aout_FilterBufferNew;
     p_filter->p_owner = NULL;
 
     p_filter->p_module = module_need( p_filter, "audio filter", NULL, false );
diff --git a/src/audio_output/input.c b/src/audio_output/input.c
index 1b32f4c..4deeb9e 100644
--- a/src/audio_output/input.c
+++ b/src/audio_output/input.c
@@ -159,7 +159,6 @@ aout_input_t *aout_InputNew (audio_output_t * p_aout,
             memcpy( &p_filter->fmt_out.audio, &chain_output_format,
                     sizeof(audio_sample_format_t) );
             p_filter->fmt_out.i_codec = chain_output_format.i_format;
-            p_filter->pf_audio_buffer_new = aout_FilterBufferNew;
 
             /* try to find the requested filter */
             if( i_visual == 2 ) /* this can only be a visualization module */



More information about the vlc-commits mailing list