Ignore:
Timestamp:
Apr 21, 2016, 9:31:10 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:
a7f398d
Parents:
bfe8256
Message:

ext/: use new proxy functions

File:
1 edited

Legend:

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

    rbfe8256 rb5bef11  
    3838  }
    3939
    40   vec = PyAubio_ArrayToCFvec (input);
    41   if (vec == NULL) {
     40  vec = (fvec_t *)malloc(sizeof(fvec_t));
     41  if (!PyAubio_ArrayToCFvec(input, vec)) {
     42    free(vec);
    4243    return NULL;
    4344  }
    4445
    4546  level_lin = Py_BuildValue("f", aubio_level_lin(vec));
     47  free(vec);
    4648  if (level_lin == NULL) {
    4749    PyErr_SetString (PyExc_ValueError, "failed computing level_lin");
     
    6870  }
    6971
    70   vec = PyAubio_ArrayToCFvec (input);
    71   if (vec == NULL) {
     72  vec = (fvec_t *)malloc(sizeof(fvec_t));
     73  if (!PyAubio_ArrayToCFvec(input, vec)) {
     74    free(vec);
    7275    return NULL;
    7376  }
    7477
    7578  db_spl = Py_BuildValue("f", aubio_db_spl(vec));
     79  free(vec);
    7680  if (db_spl == NULL) {
    7781    PyErr_SetString (PyExc_ValueError, "failed computing db_spl");
     
    99103  }
    100104
    101   vec = PyAubio_ArrayToCFvec (input);
    102   if (vec == NULL) {
     105  vec = (fvec_t *)malloc(sizeof(fvec_t));
     106  if (!PyAubio_ArrayToCFvec(input, vec)) {
     107    free(vec);
    103108    return NULL;
    104109  }
    105110
    106111  silence_detection = Py_BuildValue("I", aubio_silence_detection(vec, threshold));
     112  free(vec);
    107113  if (silence_detection == NULL) {
    108114    PyErr_SetString (PyExc_ValueError, "failed computing silence_detection");
     
    130136  }
    131137
    132   vec = PyAubio_ArrayToCFvec (input);
    133   if (vec == NULL) {
     138  vec = (fvec_t *)malloc(sizeof(fvec_t));
     139  if (!PyAubio_ArrayToCFvec(input, vec)) {
     140    free(vec);
    134141    return NULL;
    135142  }
    136143
    137144  level_detection = Py_BuildValue("f", aubio_level_detection(vec, threshold));
     145  free(vec);
    138146  if (level_detection == NULL) {
    139147    PyErr_SetString (PyExc_ValueError, "failed computing level_detection");
Note: See TracChangeset for help on using the changeset viewer.