Changeset b5bef11 for python/ext/py-sink.c
- Timestamp:
- Apr 21, 2016, 9:31:10 PM (8 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:
- a7f398d
- Parents:
- bfe8256
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
python/ext/py-sink.c
rbfe8256 rb5bef11 8 8 uint_t samplerate; 9 9 uint_t channels; 10 fvec_t *write_data; 11 fmat_t *mwrite_data; 10 12 } Py_sink; 11 13 … … 122 124 self->channels = aubio_sink_get_channels ( self->o ); 123 125 126 self->write_data = (fvec_t *)malloc(sizeof(fvec_t)); 127 self->mwrite_data = (fmat_t *)malloc(sizeof(fmat_t)); 128 self->mwrite_data->height = self->channels; 129 self->mwrite_data->data = (smpl_t **)malloc(sizeof(smpl_t*) * self->channels); 124 130 return 0; 125 131 } … … 129 135 { 130 136 del_aubio_sink(self->o); 137 free(self->write_data); 138 free(self->mwrite_data->data); 139 free(self->mwrite_data); 131 140 Py_TYPE(self)->tp_free((PyObject *) self); 132 141 } … … 140 149 141 150 /* input vectors prototypes */ 142 fvec_t* write_data;143 151 uint_t write; 144 152 … … 148 156 } 149 157 150 151 158 /* input vectors parsing */ 152 write_data = PyAubio_ArrayToCFvec (write_data_obj); 153 154 if (write_data == NULL) { 155 return NULL; 156 } 157 158 159 159 if (!PyAubio_ArrayToCFvec(write_data_obj, self->write_data)) { 160 return NULL; 161 } 160 162 161 163 162 164 /* compute _do function */ 163 aubio_sink_do (self->o, write_data, write);165 aubio_sink_do (self->o, self->write_data, write); 164 166 165 167 Py_RETURN_NONE; … … 174 176 175 177 /* input vectors prototypes */ 176 fmat_t * write_data;177 178 uint_t write; 178 179 … … 184 185 185 186 /* input vectors parsing */ 186 write_data = PyAubio_ArrayToCFmat (write_data_obj); 187 188 if (write_data == NULL) { 189 return NULL; 190 } 191 192 193 194 187 if (!PyAubio_ArrayToCFmat(write_data_obj, self->mwrite_data)) { 188 return NULL; 189 } 195 190 196 191 /* compute _do function */ 197 aubio_sink_do_multi (self->o, write_data, write);192 aubio_sink_do_multi (self->o, self->mwrite_data, write); 198 193 Py_RETURN_NONE; 199 194 }
Note: See TracChangeset
for help on using the changeset viewer.