Changeset e406835 for src/io/sink_sndfile.c
- Timestamp:
- Dec 16, 2018, 7:16:47 PM (6 years ago)
- Branches:
- feature/autosink, feature/cnn, feature/cnn_org, feature/constantq, feature/crepe, feature/crepe_org, feature/pitchshift, feature/timestretch, fix/ffmpeg5, master
- Children:
- 3e1c482
- Parents:
- cf387e3
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/io/sink_sndfile.c
rcf387e3 re406835 59 59 if (path == NULL) { 60 60 AUBIO_ERR("sink_sndfile: Aborted opening null path\n"); 61 return NULL; 62 } 63 64 if (s->path) AUBIO_FREE(s->path); 61 goto beach; 62 } 63 65 64 s->path = AUBIO_ARRAY(char_t, strnlen(path, PATH_MAX) + 1); 66 65 strncpy(s->path, path, strnlen(path, PATH_MAX) + 1); … … 98 97 s->samplerate = samplerate; 99 98 // automatically open when both samplerate and channels have been set 100 if ( s->samplerate != 0 &&s->channels != 0) {99 if (/* s->samplerate != 0 && */ s->channels != 0) { 101 100 return aubio_sink_sndfile_open(s); 102 101 } … … 111 110 s->channels = channels; 112 111 // automatically open when both samplerate and channels have been set 113 if (s->samplerate != 0 && s->channels != 0) {112 if (s->samplerate != 0 /* && s->channels != 0 */) { 114 113 return aubio_sink_sndfile_open(s); 115 114 } … … 148 147 /* allocate data for de/interleaving reallocated when needed. */ 149 148 if (s->scratch_size >= MAX_SIZE * AUBIO_MAX_CHANNELS) { 150 abort(); 151 AUBIO_ERR("sink_sndfile: %d x %d exceeds maximum aubio_sink_sndfile buffer size %d\n", 149 AUBIO_ERR("sink_sndfile: %d x %d exceeds maximum buffer size %d\n", 152 150 s->max_size, s->channels, MAX_SIZE * AUBIO_MAX_CHANNELS); 153 151 return AUBIO_FAIL; … … 218 216 219 217 void del_aubio_sink_sndfile(aubio_sink_sndfile_t * s){ 220 if (!s) return; 221 if (s->path) AUBIO_FREE(s->path); 222 aubio_sink_sndfile_close(s); 223 AUBIO_FREE(s->scratch_data); 218 AUBIO_ASSERT(s); 219 if (s->handle) 220 aubio_sink_sndfile_close(s); 221 if (s->path) 222 AUBIO_FREE(s->path); 223 if (s->scratch_data) 224 AUBIO_FREE(s->scratch_data); 224 225 AUBIO_FREE(s); 225 226 }
Note: See TracChangeset
for help on using the changeset viewer.