From: Paul Brossier Date: Thu, 17 Oct 2013 10:59:19 +0000 (+0200) Subject: src/tempo/beattracking.c: do nothing if period is zero X-Git-Tag: 0.4.0-beta1~110^2~8 X-Git-Url: https://git.aubio.org/?a=commitdiff_plain;h=2823389835532f2cf2e9f78ffc9f71dad8a8e435;p=aubio.git src/tempo/beattracking.c: do nothing if period is zero --- diff --git a/src/tempo/beattracking.c b/src/tempo/beattracking.c index 7ec0e4ec..1afab64d 100644 --- a/src/tempo/beattracking.c +++ b/src/tempo/beattracking.c @@ -182,6 +182,10 @@ aubio_beattracking_do (aubio_beattracking_t * bt, fvec_t * dfframe, bp = bt->bp; /* end of biased filterbank */ + if (bp == 0) { + output->data[0] = 0; + return; + } /* deliberate integer operation, could be set to 3 max eventually */ kmax = FLOOR (winlen / bp); @@ -381,7 +385,7 @@ aubio_beattracking_checkstate (aubio_beattracking_t * bt) /* do some further checks on the final bp value */ /* if tempo is > 206 bpm, half it */ - while (bp < 25) { + while (0 < bp && bp < 25) { #if AUBIO_BEAT_WARNINGS AUBIO_WRN ("doubling from %f (%f bpm) to %f (%f bpm)\n", bp, 60.*44100./512./bp, bp/2., 60.*44100./512./bp/2. );