Changeset b5bef11 for python/ext/py-filter.c
- Timestamp:
- Apr 21, 2016, 9:31:10 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:
- a7f398d
- Parents:
- bfe8256
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
python/ext/py-filter.c
rbfe8256 rb5bef11 6 6 aubio_filter_t * o; 7 7 uint_t order; 8 fvec_t *vec; 8 9 fvec_t *out; 9 10 } Py_filter; … … 50 51 } 51 52 self->out = new_fvec(Py_default_vector_length); 53 self->vec = (fvec_t *)malloc(sizeof(fvec_t)); 52 54 return 0; 53 55 } … … 58 60 del_fvec(self->out); 59 61 del_aubio_filter (self->o); 62 free(self->vec); 60 63 Py_TYPE(self)->tp_free ((PyObject *) self); 61 64 } … … 65 68 { 66 69 PyObject *input; 67 fvec_t *vec;68 70 69 71 if (!PyArg_ParseTuple (args, "O:digital_filter.do", &input)) { … … 75 77 } 76 78 77 vec = PyAubio_ArrayToCFvec (input); 78 79 if (vec == NULL) { 79 if (!PyAubio_ArrayToCFvec(input, self->vec)) { 80 80 return NULL; 81 81 } 82 82 83 83 // reallocate the output if needed 84 if ( vec->length != self->out->length) {84 if (self->vec->length != self->out->length) { 85 85 del_fvec(self->out); 86 self->out = new_fvec( vec->length);86 self->out = new_fvec(self->vec->length); 87 87 } 88 88 // compute the function 89 aubio_filter_do_outplace (self->o, vec, self->out);89 aubio_filter_do_outplace (self->o, self->vec, self->out); 90 90 return PyAubio_CFvecToArray(self->out); 91 91 }
Note: See TracChangeset
for help on using the changeset viewer.