Remove filter_t.pf_audio_buffer_new
authorRémi Denis-Courmont <remi@remlab.net>
Mon, 5 Sep 2011 19:39:19 +0000 (22:39 +0300)
committerRémi Denis-Courmont <remi@remlab.net>
Mon, 5 Sep 2011 19:54:57 +0000 (22:54 +0300)
include/vlc_filter.h
modules/audio_filter/channel_mixer/mono.c
modules/audio_filter/converter/dtstofloat32.c
modules/audio_filter/converter/mpgatofixed32.c
modules/stream_out/transcode/audio.c
src/audio_output/aout_internal.h
src/audio_output/filters.c
src/audio_output/input.c

index c2ec30f..1c2882c 100644 (file)
@@ -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.
index 5a630f9..dd5a0e3 100644 (file)
@@ -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" );
index 50de2b2..056accc 100644 (file)
@@ -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" );
index d77d689..8a44a14 100644 (file)
@@ -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" );
index ddc419f..55ce312 100644 (file)
@@ -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;
 }
 
index 928aa39..f8ebd79 100644 (file)
@@ -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
 {
index bd80e22..b41dc55 100644 (file)
 #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 );
index 1b32f4c..4deeb9e 100644 (file)
@@ -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 */