# include "config.h"
#endif
+#include <assert.h>
+
#include <vlc_common.h>
#include <vlc_plugin.h>
#include <vlc_aout.h>
p_mixer->mix = DoWork;
/* This is a bit kludgy - do not ask for a new buffer, since the one
* provided by the first input will be good enough. */
- p_mixer->allocation.i_alloc_type = AOUT_ALLOC_NONE;
+ p_mixer->allocation.b_alloc = false;
return 0;
}
p_input = p_mixer->input[++i];
aout_buffer_t * p_old_buffer = aout_FifoPop( NULL, &p_input->fifo );
- aout_BufferFree( p_old_buffer );
+ /* 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. */
for ( i++; i < p_mixer->input_count; i++ )