ref: 7606d2389698018c0b6ccbab28292d0646fce4c4
parent: e76eaf171d6d3e9245a6a2ccd8c5a62c38ba9729
author: Paul Brossier <piem@piem.org>
date: Wed Mar 6 05:07:00 EST 2013
tests/src/io/test-source.c: abort if new_aubio_source failed
--- a/tests/src/io/test-source.c
+++ b/tests/src/io/test-source.c
@@ -28,11 +28,12 @@
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 @@
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;