Commit ea422217 authored by David Fuhrmann's avatar David Fuhrmann

auhal: don't leak audio data and avoid useless memcpy

parent 46369f3e
...@@ -1181,20 +1181,11 @@ static void Play (audio_output_t * p_aout, block_t * p_block) ...@@ -1181,20 +1181,11 @@ static void Play (audio_output_t * p_aout, block_t * p_block)
VLC_CODEC_FL32); VLC_CODEC_FL32);
} }
/* Render audio into buffer */
AudioBufferList bufferList;
bufferList.mNumberBuffers = 1;
bufferList.mBuffers[0].mNumberChannels = p_sys->i_numberOfChannels;
bufferList.mBuffers[0].mData = malloc(p_block->i_nb_samples * sizeof(Float32) * p_sys->i_numberOfChannels);
bufferList.mBuffers[0].mDataByteSize = p_block->i_nb_samples * sizeof(Float32) * p_sys->i_numberOfChannels;
memcpy(bufferList.mBuffers[0].mData, p_block->p_buffer, p_block->i_buffer);
/* keep track of the played data */ /* keep track of the played data */
p_aout->sys->i_played_length += p_block->i_length; p_aout->sys->i_played_length += p_block->i_length;
/* move data to buffer */ /* move data to buffer */
TPCircularBufferProduceBytes(&p_sys->circular_buffer, bufferList.mBuffers[0].mData, bufferList.mBuffers[0].mDataByteSize); TPCircularBufferProduceBytes(&p_sys->circular_buffer, p_block->p_buffer, p_block->i_buffer);
} }
block_Release(p_block); block_Release(p_block);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment