- int i = 0;
- aout_input_t * p_input = p_aout->pp_inputs[i];
- while ( p_input->b_error )
- {
- p_input = p_aout->pp_inputs[++i];
- }
- aout_FifoPop( p_aout, &p_input->fifo );
+ VLC_UNUSED( p_buffer );
+
+ unsigned i = 0;
+ aout_mixer_input_t * p_input = p_mixer->input[i];
+ while ( p_input->is_invalid )
+ 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 );