[vlc-devel] commit: spdif: Add a comment to explicitely explain why we don' t free old buffer. (Pierre d'Herbemont )

git version control git at videolan.org
Thu Sep 3 23:31:21 CEST 2009


vlc | branch: master | Pierre d'Herbemont <pdherbemont at free.fr> | Thu Sep  3 23:30:53 2009 +0200| [acac88798ee6fd5ec0ea59bdaef0a4989f6409cd] | committer: Pierre d'Herbemont 

spdif: Add a comment to explicitely explain why we don't free old buffer.

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

 modules/audio_mixer/spdif.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/modules/audio_mixer/spdif.c b/modules/audio_mixer/spdif.c
index f06fad2..c21e6e6 100644
--- a/modules/audio_mixer/spdif.c
+++ b/modules/audio_mixer/spdif.c
@@ -86,6 +86,10 @@ static void DoWork( aout_mixer_t * p_mixer, aout_buffer_t * p_buffer )
         p_input = p_mixer->input[++i];
 
     aout_buffer_t * p_old_buffer = aout_FifoPop( NULL, &p_input->fifo );
+    /* We don't free the old buffer because,
+     * The aout core use a hack to avoid useless memcpy: the buffer in which
+     * to mix is the same as the one in the first active input fifo.
+     * So the ownership of that buffer belongs to our caller */
     assert( p_old_buffer == p_buffer );
 
     /* Empty other FIFOs to avoid a memory leak. */




More information about the vlc-devel mailing list