Changeset 21e8408 for python/ext
- Timestamp:
- Apr 29, 2016, 11:48:39 PM (9 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:
- e84f7b9
- Parents:
- b055b4e
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
python/ext/py-filter.c
rb055b4e r21e8408 7 7 uint_t order; 8 8 fvec_t vec; 9 fvec_t *out; 9 PyObject *out; 10 fvec_t c_out; 10 11 } Py_filter; 11 12 … … 50 51 return -1; 51 52 } 52 self->out = new_fvec(Py_default_vector_length);53 self->out = NULL; 53 54 return 0; 54 55 } … … 57 58 Py_filter_del (Py_filter * self) 58 59 { 59 del_fvec(self->out);60 Py_XDECREF(self->out); 60 61 del_aubio_filter (self->o); 61 62 Py_TYPE(self)->tp_free ((PyObject *) self); 62 63 } 63 64 64 static PyObject * 65 static PyObject * 65 66 Py_filter_do(Py_filter * self, PyObject * args) 66 67 { … … 79 80 } 80 81 81 // reallocate the output if needed 82 if (self->vec.length != self->out->length) { 83 del_fvec(self->out); 84 self->out = new_fvec(self->vec.length); 82 // initialize output now 83 if (self->out == NULL) { 84 self->out = new_py_fvec(self->vec.length); 85 } 86 87 Py_INCREF(self->out); 88 if (!PyAubio_ArrayToCFvec(self->out, &(self->c_out)) ) { 89 return NULL; 85 90 } 86 91 // compute the function 87 aubio_filter_do_outplace (self->o, &(self->vec), self->out);88 return PyAubio_CFvecToArray(self->out);89 } 90 91 static PyObject * 92 aubio_filter_do_outplace (self->o, &(self->vec), &(self->c_out)); 93 return self->out; 94 } 95 96 static PyObject * 92 97 Py_filter_set_c_weighting (Py_filter * self, PyObject *args) 93 98 { … … 107 112 } 108 113 109 static PyObject * 114 static PyObject * 110 115 Py_filter_set_a_weighting (Py_filter * self, PyObject *args) 111 116 {
Note: See TracChangeset
for help on using the changeset viewer.