[vlc-commits] Remove unused/unusable decoder_DeleteAudioBuffer()

Rémi Denis-Courmont git at videolan.org
Thu Aug 25 21:40:58 CEST 2011


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Thu Aug 25 22:37:42 2011 +0300| [ab625e9f8c10ffe42582c0922559979b5bdc16e4] | committer: Rémi Denis-Courmont

Remove unused/unusable decoder_DeleteAudioBuffer()

Audio buffers are destroyed downstream of the decoder, so this
function could never be used. In practice, the audio filters, the
audio output (or the encoder) already use block_Release() to delete
buffers allocated with decoder_NewAudioBuffer().

If "direct rendering" is ever implemented in audio output,
block_Release() custom buffer deletion can be used.

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

 include/vlc_codec.h                  |    6 ------
 modules/stream_out/transcode/audio.c |    7 -------
 src/input/decoder.c                  |   12 ------------
 src/libvlccore.sym                   |    1 -
 4 files changed, 0 insertions(+), 26 deletions(-)

diff --git a/include/vlc_codec.h b/include/vlc_codec.h
index d7d7769..3322ebe 100644
--- a/include/vlc_codec.h
+++ b/include/vlc_codec.h
@@ -105,7 +105,6 @@ struct decoder_t
     /* Audio output callbacks
      * XXX use decoder_NewAudioBuffer/decoder_DeleteAudioBuffer */
     aout_buffer_t  *(*pf_aout_buffer_new)( decoder_t *, int );
-    void            (*pf_aout_buffer_del)( decoder_t *, aout_buffer_t * );
 
     /* SPU output callbacks
      * XXX use decoder_NewSubpicture and decoder_DeleteSubpicture */
@@ -207,11 +206,6 @@ VLC_API void decoder_UnlinkPicture( decoder_t *, picture_t * );
 VLC_API aout_buffer_t * decoder_NewAudioBuffer( decoder_t *, int i_size ) VLC_USED;
 
 /**
- * This function will release a audio buffer created by decoder_NewAudioBuffer.
- */
-VLC_API void decoder_DeleteAudioBuffer( decoder_t *, aout_buffer_t *p_buffer );
-
-/**
  * This function will return a new subpicture usable by a decoder as an output
  * buffer. You have to release it using decoder_DeleteSubpicture or by returning
  * it to the caller as a pf_decode_sub return value.
diff --git a/modules/stream_out/transcode/audio.c b/modules/stream_out/transcode/audio.c
index f2d2ea1..ddc419f 100644
--- a/modules/stream_out/transcode/audio.c
+++ b/modules/stream_out/transcode/audio.c
@@ -94,12 +94,6 @@ static aout_buffer_t *audio_new_buffer( decoder_t *p_dec, int i_samples )
     return p_block;
 }
 
-static void audio_del_buffer( decoder_t *p_dec, aout_buffer_t *p_buffer )
-{
-    VLC_UNUSED(p_dec);
-    block_Release( p_buffer );
-}
-
 static int transcode_audio_filter_allocation_init( filter_t *p_filter,
                                                    void *data )
 {
@@ -224,7 +218,6 @@ int transcode_audio_new( sout_stream_t *p_stream,
     id->p_decoder->fmt_out.p_extra = 0;
     id->p_decoder->pf_decode_audio = NULL;
     id->p_decoder->pf_aout_buffer_new = audio_new_buffer;
-    id->p_decoder->pf_aout_buffer_del = audio_del_buffer;
     /* id->p_decoder->p_cfg = p_sys->p_audio_cfg; */
 
     id->p_decoder->p_module =
diff --git a/src/input/decoder.c b/src/input/decoder.c
index 47f8b80..7af15e5 100644
--- a/src/input/decoder.c
+++ b/src/input/decoder.c
@@ -213,10 +213,6 @@ aout_buffer_t *decoder_NewAudioBuffer( decoder_t *p_decoder, int i_size )
         return NULL;
     return p_decoder->pf_aout_buffer_new( p_decoder, i_size );
 }
-void decoder_DeleteAudioBuffer( decoder_t *p_decoder, aout_buffer_t *p_buffer )
-{
-    p_decoder->pf_aout_buffer_del( p_decoder, p_buffer );
-}
 
 subpicture_t *decoder_NewSubpicture( decoder_t *p_decoder,
                                      const subpicture_updater_t *p_dyn )
@@ -800,7 +796,6 @@ static decoder_t * CreateDecoder( vlc_object_t *p_parent,
 
     /* Set buffers allocation callbacks for the decoders */
     p_dec->pf_aout_buffer_new = aout_new_buffer;
-    p_dec->pf_aout_buffer_del = aout_del_buffer;
     p_dec->pf_vout_buffer_new = vout_new_buffer;
     p_dec->pf_vout_buffer_del = vout_del_buffer;
     p_dec->pf_picture_link    = vout_link_picture;
@@ -2315,13 +2310,6 @@ static aout_buffer_t *aout_new_buffer( decoder_t *p_dec, int i_samples )
     return p_buffer;
 }
 
-static void aout_del_buffer( decoder_t *p_dec, aout_buffer_t *p_buffer )
-{
-    decoder_owner_sys_t *p_owner = p_dec->p_owner;
-
-    aout_DecDeleteBuffer( p_owner->p_aout, p_buffer );
-}
-
 static picture_t *vout_new_buffer( decoder_t *p_dec )
 {
     decoder_owner_sys_t *p_owner = p_dec->p_owner;
diff --git a/src/libvlccore.sym b/src/libvlccore.sym
index 74c8e14..7eb6e60 100644
--- a/src/libvlccore.sym
+++ b/src/libvlccore.sym
@@ -80,7 +80,6 @@ date_Increment
 date_Init
 date_Move
 date_Set
-decoder_DeleteAudioBuffer
 decoder_DeletePicture
 decoder_DeleteSubpicture
 decoder_GetDisplayDate



More information about the vlc-commits mailing list