Changeset dfe6ab6 for python/ext/py-source.c
- Timestamp:
- Mar 31, 2019, 9:58:02 PM (5 years ago)
- Branches:
- feature/constantq
- Children:
- 9492313a
- Parents:
- 868c6b8 (diff), f55630c (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
python/ext/py-source.c
r868c6b8 rdfe6ab6 437 437 aubio_source_do (self->o, &(self->c_read_to), &read); 438 438 439 if (PyErr_Occurred() != NULL) { 440 return NULL; 441 } 442 439 443 outputs = PyTuple_New(2); 440 444 PyTuple_SetItem( outputs, 0, self->read_to ); … … 457 461 /* compute _do function */ 458 462 aubio_source_do_multi (self->o, &(self->c_mread_to), &read); 463 464 if (PyErr_Occurred() != NULL) { 465 return NULL; 466 } 459 467 460 468 outputs = PyTuple_New(2); … … 574 582 } else if (PyLong_AsLong(size) > 0) { 575 583 // short read, return a shorter array 576 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 = (PyArrayObject*)PyArray_FROM_OTF(vec, 587 NPY_NOTYPE, NPY_ARRAY_ENSURECOPY); 577 588 PyArray_Dims newdims; 578 589 PyObject *reshaped; … … 587 598 reshaped = PyArray_Newshape(shortread, &newdims, NPY_CORDER); 588 599 Py_DECREF(shortread); 600 Py_DECREF(vec); 589 601 return reshaped; 590 602 } else {
Note: See TracChangeset
for help on using the changeset viewer.