Ignore:
Timestamp:
Mar 31, 2019, 9:58:02 PM (5 years ago)
Author:
Paul Brossier <piem@piem.org>
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.
Message:

Merge branch 'master' into feature/constantq

File:
1 edited

Legend:

Unmodified
Added
Removed
  • python/ext/py-source.c

    r868c6b8 rdfe6ab6  
    437437  aubio_source_do (self->o, &(self->c_read_to), &read);
    438438
     439  if (PyErr_Occurred() != NULL) {
     440    return NULL;
     441  }
     442
    439443  outputs = PyTuple_New(2);
    440444  PyTuple_SetItem( outputs, 0, self->read_to );
     
    457461  /* compute _do function */
    458462  aubio_source_do_multi (self->o, &(self->c_mread_to), &read);
     463
     464  if (PyErr_Occurred() != NULL) {
     465    return NULL;
     466  }
    459467
    460468  outputs = PyTuple_New(2);
     
    574582    } else if (PyLong_AsLong(size) > 0) {
    575583      // 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);
    577588      PyArray_Dims newdims;
    578589      PyObject *reshaped;
     
    587598      reshaped = PyArray_Newshape(shortread, &newdims, NPY_CORDER);
    588599      Py_DECREF(shortread);
     600      Py_DECREF(vec);
    589601      return reshaped;
    590602    } else {
Note: See TracChangeset for help on using the changeset viewer.