ref: 21e2e6dbc416395d697a4d54aaa58f757e1c3073
parent: ce1d788fb2fa6041457e398e367562d93d845127
author: Paul Brossier <[email protected]>
date: Sat Dec 7 07:38:07 EST 2013
src/pitch/pitch.c: aubio_pitch_set_unit returns AUBIO_FAIL on fail
--- a/src/pitch/pitch.c
+++ b/src/pitch/pitch.c
@@ -232,6 +232,7 @@
uint_t
aubio_pitch_set_unit (aubio_pitch_t * p, char_t * pitch_unit)
{
+ uint_t err = AUBIO_OK;
aubio_pitch_mode pitch_mode;
if (strcmp (pitch_unit, "freq") == 0)
pitch_mode = aubio_pitchm_freq;
@@ -246,6 +247,7 @@
else {
AUBIO_ERR ("unknown pitch detection unit %s, using default\n", pitch_unit);
pitch_mode = aubio_pitchm_default;
+ err = AUBIO_FAIL;
}
p->mode = pitch_mode;
switch (p->mode) {
@@ -265,7 +267,7 @@
default:
break;
}
- return AUBIO_OK;
+ return err;
}
uint_t