From 7606d2389698018c0b6ccbab28292d0646fce4c4 Mon Sep 17 00:00:00 2001 From: Paul Brossier Date: Wed, 6 Mar 2013 10:07:00 -0500 Subject: [PATCH] tests/src/io/test-source.c: abort if new_aubio_source failed --- tests/src/io/test-source.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) 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; -- 2.26.2