]> git.sesse.net Git - vlc/commitdiff
spdif: Add a comment to explicitely explain why we don't free old buffer.
authorPierre d'Herbemont <pdherbemont@free.fr>
Thu, 3 Sep 2009 21:30:53 +0000 (23:30 +0200)
committerPierre d'Herbemont <pdherbemont@free.fr>
Thu, 3 Sep 2009 21:30:53 +0000 (23:30 +0200)
modules/audio_mixer/spdif.c

index f06fad2c547cddab25adc6d644e2e93db3985d6e..c21e6e6094c74f95b04f52a0a8c8620cf37a07fe 100644 (file)
@@ -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. */