From acac88798ee6fd5ec0ea59bdaef0a4989f6409cd Mon Sep 17 00:00:00 2001 From: Pierre d'Herbemont Date: Thu, 3 Sep 2009 23:30:53 +0200 Subject: [PATCH] spdif: Add a comment to explicitely explain why we don't free old buffer. --- modules/audio_mixer/spdif.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/modules/audio_mixer/spdif.c b/modules/audio_mixer/spdif.c index f06fad2c54..c21e6e6094 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. */ -- 2.39.2