Changeset 19f222d for src/io


Ignore:
Timestamp:
Mar 23, 2013, 1:09:53 AM (12 years ago)
Author:
Paul Brossier <piem@piem.org>
Branches:
feature/autosink, feature/cnn, feature/cnn_org, feature/constantq, feature/crepe, feature/crepe_org, feature/pitchshift, feature/pydocstrings, feature/timestretch, fix/ffmpeg5, master, pitchshift, sampler, timestretch, yinfft+
Children:
2525f81, bd1fa89
Parents:
3286230
Message:

src/io/utils_apple_audio.c: use AUBIO_ARRAY / AUBIO_FREE

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/io/utils_apple_audio.c

    r3286230 r19f222d  
    55// ExtAudioFileRef, AudioStreamBasicDescription, AudioBufferList, ...
    66#include <AudioToolbox/AudioToolbox.h>
     7#include "aubio_priv.h"
    78
    89int createAubioBufferList(AudioBufferList *bufferList, int channels, int segmentSize);
     
    1314  bufferList->mNumberBuffers = 1;
    1415  bufferList->mBuffers[0].mNumberChannels = channels;
    15   bufferList->mBuffers[0].mData = (short *)malloc(segmentSize * sizeof(short));
     16  bufferList->mBuffers[0].mData = AUBIO_ARRAY(short, segmentSize);
    1617  bufferList->mBuffers[0].mDataByteSize = segmentSize * sizeof(short);
    1718  return 0;
     
    2324  for (i = 0; i < bufferList->mNumberBuffers; i++) {
    2425    if (bufferList->mBuffers[i].mData) {
    25       free (bufferList->mBuffers[i].mData);
     26      AUBIO_FREE(bufferList->mBuffers[i].mData);
    2627      bufferList->mBuffers[i].mData = NULL;
    2728    }
Note: See TracChangeset for help on using the changeset viewer.