Changeset 569b363 for python/ext/aubioproxy.c
- Timestamp:
- Apr 24, 2016, 6:23:14 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:
- 51b9c83
- Parents:
- a35db12
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
python/ext/aubioproxy.c
ra35db12 r569b363 144 144 } 145 145 146 if (mat->height != (uint_t)PyArray_DIM ((PyArrayObject *)input, 0)) { 147 /* 148 free(mat->data); 149 mat->height = (uint_t)PyArray_DIM ((PyArrayObject *)input, 0); 150 mat->data = (smpl_t **)malloc(sizeof(smpl_t*) * mat->height); 151 */ 152 PyErr_Format(PyExc_ValueError, "too many rows, %d but %ld expected", 153 mat->height, PyArray_DIM ((PyArrayObject *)input, 0) ); 154 return 0; 146 uint_t new_height = (uint_t)PyArray_DIM ((PyArrayObject *)input, 0); 147 if (mat->height != new_height) { 148 if (mat->data) { 149 free(mat->data); 150 } 151 mat->data = (smpl_t **)malloc(sizeof(smpl_t*) * new_height); 155 152 } 156 153 154 mat->height = new_height; 157 155 mat->length = (uint_t)PyArray_DIM ((PyArrayObject *)input, 1); 158 156 for (i=0; i< mat->height; i++) {
Note: See TracChangeset
for help on using the changeset viewer.