From: Paul Brossier Date: Sat, 23 Mar 2013 00:09:53 +0000 (-0500) Subject: src/io/utils_apple_audio.c: use AUBIO_ARRAY / AUBIO_FREE X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=19f222d84d42721aa650f5dc006088e83a9ba2c3;p=aubio.git src/io/utils_apple_audio.c: use AUBIO_ARRAY / AUBIO_FREE --- diff --git a/src/io/utils_apple_audio.c b/src/io/utils_apple_audio.c index dbd1fbd9..31538edd 100644 --- a/src/io/utils_apple_audio.c +++ b/src/io/utils_apple_audio.c @@ -4,6 +4,7 @@ #include // ExtAudioFileRef, AudioStreamBasicDescription, AudioBufferList, ... #include +#include "aubio_priv.h" int createAubioBufferList(AudioBufferList *bufferList, int channels, int segmentSize); void freeAudioBufferList(AudioBufferList *bufferList); @@ -12,7 +13,7 @@ CFURLRef getURLFromPath(const char * path); int createAubioBufferList(AudioBufferList * bufferList, int channels, int segmentSize) { bufferList->mNumberBuffers = 1; bufferList->mBuffers[0].mNumberChannels = channels; - bufferList->mBuffers[0].mData = (short *)malloc(segmentSize * sizeof(short)); + bufferList->mBuffers[0].mData = AUBIO_ARRAY(short, segmentSize); bufferList->mBuffers[0].mDataByteSize = segmentSize * sizeof(short); return 0; } @@ -22,7 +23,7 @@ void freeAudioBufferList(AudioBufferList *bufferList) { if (!bufferList) return; for (i = 0; i < bufferList->mNumberBuffers; i++) { if (bufferList->mBuffers[i].mData) { - free (bufferList->mBuffers[i].mData); + AUBIO_FREE(bufferList->mBuffers[i].mData); bufferList->mBuffers[i].mData = NULL; } }