From: Paul Brossier Date: Wed, 6 Mar 2013 15:07:00 +0000 (-0500) Subject: tests/src/io/test-source.c: abort if new_aubio_source failed X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=7606d2389698018c0b6ccbab28292d0646fce4c4;p=aubio.git tests/src/io/test-source.c: abort if new_aubio_source failed --- diff --git a/tests/src/io/test-source.c b/tests/src/io/test-source.c index d3ebe9e8..342ef406 100644 --- a/tests/src/io/test-source.c +++ b/tests/src/io/test-source.c @@ -28,11 +28,12 @@ int main (int argc, char **argv) char_t *source_path = argv[1]; fvec_t *vec = new_fvec(hop_size); - aubio_source_t* s = new_aubio_source(source_path, samplerate, hop_size); - if (samplerate == 0 ) samplerate = aubio_source_get_samplerate(s); + aubio_source_t* s = new_aubio_source(source_path, samplerate, hop_size); if (!s) { err = 1; goto beach; } + if (samplerate == 0 ) samplerate = aubio_source_get_samplerate(s); + do { aubio_source_do(s, vec, &read); // fvec_print (vec); @@ -42,8 +43,8 @@ int main (int argc, char **argv) PRINT_MSG("read %d frames at %dHz (%d blocks) from %s\n", n_frames, samplerate, n_frames / hop_size, source_path); -beach: del_aubio_source (s); +beach: del_fvec (vec); return err;