Ignore:
Timestamp:
Apr 21, 2016, 7:01:50 PM (9 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:
26a6af7
Parents:
ae5d58a
Message:

src/io/*.c: take a copy of const char* path

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/io/source_apple_audio.c

    rae5d58a rb643a33  
    8080  s->block_size = block_size;
    8181  s->samplerate = samplerate;
    82   s->path = path;
    8382
    8483  if ( aubio_source_apple_audio_open ( s, path ) ) {
     
    9695  OSStatus err = noErr;
    9796  UInt32 propSize;
    98   s->path = path;
     97
     98  if (s->path) AUBIO_FREE(s->path);
     99  s->path = AUBIO_ARRAY(char_t, strnlen(path, PATH_MAX));
     100  strncpy(s->path, path, strnlen(path, PATH_MAX));
    99101
    100102  // open the resource url
    101   CFURLRef fileURL = createURLFromPath(path);
     103  CFURLRef fileURL = createURLFromPath(s->path);
    102104  err = ExtAudioFileOpenURL(fileURL, &s->audioFile);
    103105  CFRelease(fileURL);
     
    294296void del_aubio_source_apple_audio(aubio_source_apple_audio_t * s){
    295297  aubio_source_apple_audio_close (s);
     298  if (s->path) AUBIO_FREE(s->path);
    296299  freeAudioBufferList(&s->bufferList);
    297300  AUBIO_FREE(s);
Note: See TracChangeset for help on using the changeset viewer.