Changeset ab7d100 for tests


Ignore:
Timestamp:
Jul 16, 2012, 8:19:29 PM (12 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:
18c6b20
Parents:
c6c9fe9
Message:

tests/src/io/test-source_sndfile.c: avoid memory leak

File:
1 edited

Legend:

Unmodified
Added
Removed
  • tests/src/io/test-source_sndfile.c

    rc6c9fe9 rab7d100  
    33#include "config.h"
    44
    5 char_t *path = "/home/piem/archives/drum_Chocolate_Milk_-_Ation_Speaks_Louder_Than_Words.wav";
     5char_t *path = "/home/piem/archives/samples/loops/drum_Chocolate_Milk_-_Ation_Speaks_Louder_Than_Words.wav";
    66
    77int main(){
     8  int err = 0;
    89#ifdef HAVE_SNDFILE
    9   uint_t samplerate = 32000;
     10  uint_t samplerate = 192000;
    1011  uint_t hop_size = 512;
    1112  uint_t read = hop_size;
     
    1314  aubio_source_sndfile_t * s = new_aubio_source_sndfile(path, samplerate, hop_size);
    1415
    15   if (!s) return -1;
     16  if (!s) { err = 1; goto beach; }
    1617
    1718  while ( read == hop_size ) {
     
    2122  }
    2223
     24beach:
    2325  del_aubio_source_sndfile(s);
     26  del_fvec(vec);
    2427#else
    2528  fprintf(stderr, "ERR: aubio was not compiled with aubio_source_sndfile\n");
     29  err = 2;
    2630#endif /* HAVE_SNDFILE */
    27   return 0;
     31  return err;
    2832}
    2933
Note: See TracChangeset for help on using the changeset viewer.