Changeset 966c650 for python/ext/py-source.c
- Timestamp:
- Dec 23, 2018, 5:46:47 AM (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:
- cd46892
- Parents:
- 79dc9ad
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
python/ext/py-source.c
r79dc9ad r966c650 582 582 } else if (PyLong_AsLong(size) > 0) { 583 583 // short read, return a shorter array 584 PyArrayObject *shortread = (PyArrayObject*)PyTuple_GetItem(done, 0); 584 PyObject *vec = PyTuple_GetItem(done, 0); 585 // take a copy to prevent resizing internal arrays 586 PyArrayObject *shortread = PyArray_FROM_OTF(vec, NPY_NOTYPE, 587 NPY_ARRAY_ENSURECOPY); 585 588 PyArray_Dims newdims; 586 589 PyObject *reshaped; … … 595 598 reshaped = PyArray_Newshape(shortread, &newdims, NPY_CORDER); 596 599 Py_DECREF(shortread); 600 Py_DECREF(vec); 597 601 return reshaped; 598 602 } else {
Note: See TracChangeset
for help on using the changeset viewer.