Ignore:
Timestamp:
Apr 28, 2016, 6:59:55 PM (8 years ago)
Author:
Paul Brossier <piem@piem.org>
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:
6937842
Parents:
1f4d932
Message:

python/ext/py-cvec.c: rewrite and simplify aubio.cvec, safer and better memory usage (see #49)

File:
1 edited

Legend:

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

    r1f4d932 r92a8800  
    1111  fvec_t vecin;
    1212  cvec_t *output;
    13   Py_cvec *py_out;
    1413  cvec_t cvecin;
    1514  fvec_t *routput;
     
    7372
    7473  self->output = new_cvec(self->win_s);
    75   self->py_out = (Py_cvec*) PyObject_New (Py_cvec, &Py_cvecType);
    7674  self->routput = new_fvec(self->hop_s);
    7775
     
    105103  // compute the function
    106104  aubio_pvoc_do (self->o, &(self->vecin), self->output);
    107 #if 0
    108   Py_cvec * py_out = (Py_cvec*) PyObject_New (Py_cvec, &Py_cvecType);
    109   PyObject* output = PyAubio_CCvecToPyCvec(self->output, py_out);
    110   return output;
    111 #else
    112   // convert cvec to py_cvec, incrementing refcount to keep a copy
    113   return PyAubio_CCvecToPyCvec(self->output, self->py_out);
    114 #endif
     105  // convert cvec to py_cvec
     106  return PyAubio_CCvecToPyCvec(self->output);
    115107}
    116108
     
    131123  }
    132124
    133   if (!PyAubio_ArrayToCCvec (input, &(self->cvecin) )) {
     125  if (!PyAubio_PyCvecToCCvec (input, &(self->cvecin) )) {
    134126    return NULL;
    135127  }
Note: See TracChangeset for help on using the changeset viewer.