Changeset b643a33
- Timestamp:
- Apr 21, 2016, 7:01:50 PM (9 years ago)
- 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
- Location:
- src/io
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
src/io/sink_apple_audio.c
rae5d58a rb643a33 60 60 aubio_sink_apple_audio_t * new_aubio_sink_apple_audio(const char_t * uri, uint_t samplerate) { 61 61 aubio_sink_apple_audio_t * s = AUBIO_NEW(aubio_sink_apple_audio_t); 62 s->path = uri;63 62 s->max_frames = MAX_SIZE; 64 63 s->async = false; … … 68 67 goto beach; 69 68 } 69 if (s->path != NULL) AUBIO_FREE(s->path); 70 s->path = AUBIO_ARRAY(char_t, strnlen(uri, PATH_MAX)); 71 strncpy(s->path, uri, strnlen(uri, PATH_MAX)); 70 72 71 73 s->samplerate = 0; … … 250 252 void del_aubio_sink_apple_audio(aubio_sink_apple_audio_t * s) { 251 253 if (s->audioFile) aubio_sink_apple_audio_close (s); 254 if (s->path) AUBIO_FREE(s->path); 252 255 freeAudioBufferList(&s->bufferList); 253 256 AUBIO_FREE(s); -
src/io/sink_sndfile.c
rae5d58a rb643a33 57 57 aubio_sink_sndfile_t * s = AUBIO_NEW(aubio_sink_sndfile_t); 58 58 s->max_size = MAX_SIZE; 59 s->path = path;60 59 61 60 if (path == NULL) { … … 63 62 return NULL; 64 63 } 64 65 if (s->path) AUBIO_FREE(s->path); 66 s->path = AUBIO_ARRAY(char_t, strnlen(path, PATH_MAX)); 67 strncpy(s->path, path, strnlen(path, PATH_MAX)); 65 68 66 69 s->samplerate = 0; … … 220 223 void del_aubio_sink_sndfile(aubio_sink_sndfile_t * s){ 221 224 if (!s) return; 225 if (s->path) AUBIO_FREE(s->path); 222 226 aubio_sink_sndfile_close(s); 223 227 AUBIO_FREE(s->scratch_data); -
src/io/sink_wavwrite.c
rae5d58a rb643a33 90 90 } 91 91 92 s->path = path; 92 if (s->path) AUBIO_FREE(s->path); 93 s->path = AUBIO_ARRAY(char_t, strnlen(path, PATH_MAX)); 94 strncpy(s->path, path, strnlen(path, PATH_MAX)); 95 93 96 s->max_size = MAX_SIZE; 94 97 s->bitspersample = 16; … … 288 291 if (!s) return; 289 292 aubio_sink_wavwrite_close(s); 293 if (s->path) AUBIO_FREE(s->path); 290 294 AUBIO_FREE(s->scratch_data); 291 295 AUBIO_FREE(s); -
src/io/source_apple_audio.c
rae5d58a rb643a33 80 80 s->block_size = block_size; 81 81 s->samplerate = samplerate; 82 s->path = path;83 82 84 83 if ( aubio_source_apple_audio_open ( s, path ) ) { … … 96 95 OSStatus err = noErr; 97 96 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)); 99 101 100 102 // open the resource url 101 CFURLRef fileURL = createURLFromPath( path);103 CFURLRef fileURL = createURLFromPath(s->path); 102 104 err = ExtAudioFileOpenURL(fileURL, &s->audioFile); 103 105 CFRelease(fileURL); … … 294 296 void del_aubio_source_apple_audio(aubio_source_apple_audio_t * s){ 295 297 aubio_source_apple_audio_close (s); 298 if (s->path) AUBIO_FREE(s->path); 296 299 freeAudioBufferList(&s->bufferList); 297 300 AUBIO_FREE(s); -
src/io/source_avcodec.c
rae5d58a rb643a33 85 85 s->hop_size = hop_size; 86 86 s->channels = 1; 87 s->path = path; 87 88 if (s->path) AUBIO_FREE(s->path); 89 s->path = AUBIO_ARRAY(char_t, strnlen(path, PATH_MAX)); 90 strncpy(s->path, path, strnlen(path, PATH_MAX)); 88 91 89 92 // register all formats and codecs … … 425 428 av_frame_free( &(s->avFrame) ); 426 429 } 430 if (s->path) AUBIO_FREE(s->path); 427 431 s->avFrame = NULL; 428 432 AUBIO_FREE(s); -
src/io/source_sndfile.c
rae5d58a rb643a33 87 87 s->hop_size = hop_size; 88 88 s->channels = 1; 89 s->path = path; 89 90 if (s->path) AUBIO_FREE(s->path); 91 s->path = AUBIO_ARRAY(char_t, strnlen(path, PATH_MAX)); 92 strncpy(s->path, path, strnlen(path, PATH_MAX)); 90 93 91 94 // try opening the file, getting the info in sfinfo … … 306 309 } 307 310 #endif /* HAVE_SAMPLERATE */ 311 if (s->path) AUBIO_FREE(s->path); 308 312 AUBIO_FREE(s->scratch_data); 309 313 AUBIO_FREE(s); -
src/io/source_wavread.c
rae5d58a rb643a33 87 87 } 88 88 89 s->path = path; 89 if (s->path) AUBIO_FREE(s->path); 90 s->path = AUBIO_ARRAY(char_t, strnlen(path, PATH_MAX)); 91 strncpy(s->path, path, strnlen(path, PATH_MAX)); 92 90 93 s->samplerate = samplerate; 91 94 s->hop_size = hop_size; … … 389 392 if (s->short_output) AUBIO_FREE(s->short_output); 390 393 if (s->output) del_fmat(s->output); 394 if (s->path) AUBIO_FREE(s->path); 391 395 AUBIO_FREE(s); 392 396 }
Note: See TracChangeset
for help on using the changeset viewer.