[vlc-commits] auhal: don't leak audio data and avoid useless memcpy
David Fuhrmann
git at videolan.org
Mon Feb 18 19:27:44 CET 2013
vlc | branch: master | David Fuhrmann <david.fuhrmann at googlemail.com> | Mon Feb 18 19:09:55 2013 +0100| [ea422217077165f39842b0501dfdefe59a0f6b7d] | committer: David Fuhrmann
auhal: don't leak audio data and avoid useless memcpy
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=ea422217077165f39842b0501dfdefe59a0f6b7d
---
modules/audio_output/auhal.c | 11 +----------
1 file changed, 1 insertion(+), 10 deletions(-)
diff --git a/modules/audio_output/auhal.c b/modules/audio_output/auhal.c
index 292c451..d1f5eb1 100644
--- a/modules/audio_output/auhal.c
+++ b/modules/audio_output/auhal.c
@@ -1181,20 +1181,11 @@ static void Play (audio_output_t * p_aout, block_t * p_block)
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 */
p_aout->sys->i_played_length += p_block->i_length;
/* 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);
More information about the vlc-commits
mailing list