From 4acee979d28ca54e694357e83eebc6de4818d40b Mon Sep 17 00:00:00 2001 From: Paul Brossier Date: Thu, 29 Sep 2016 23:07:19 +0200 Subject: [PATCH] src/effects/timestretch_rubberband.c: fix eof when last available == hopsize, change _set messages to warnings --- src/effects/timestretch_rubberband.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/effects/timestretch_rubberband.c b/src/effects/timestretch_rubberband.c index 69224c1c..d14e7269 100644 --- a/src/effects/timestretch_rubberband.c +++ b/src/effects/timestretch_rubberband.c @@ -136,7 +136,7 @@ aubio_timestretch_set_stretch (aubio_timestretch_t * p, smpl_t stretch) rubberband_set_time_ratio(p->rb, 1./p->stretchratio); return AUBIO_OK; } else { - AUBIO_ERR("timestretch: could not set stretch ratio to %.2f\n", stretch); + AUBIO_WRN("timestretch: could not set stretch ratio to %.2f\n", stretch); return AUBIO_FAIL; } } @@ -155,7 +155,7 @@ aubio_timestretch_set_pitchscale (aubio_timestretch_t * p, smpl_t pitchscale) rubberband_set_pitch_scale(p->rb, p->pitchscale); return AUBIO_OK; } else { - AUBIO_ERR("timestretch: could not set pitchscale to %.2f\n", pitchscale); + AUBIO_WRN("timestretch: could not set pitchscale to %.2f\n", pitchscale); return AUBIO_FAIL; } } @@ -173,7 +173,7 @@ aubio_timestretch_set_transpose(aubio_timestretch_t * p, smpl_t transpose) smpl_t pitchscale = POW(2., transpose / 12.); return aubio_timestretch_set_pitchscale(p, pitchscale); } else { - AUBIO_ERR("timestretch: could not set transpose to %.2f\n", transpose); + AUBIO_WRN("timestretch: could not set transpose to %.2f\n", transpose); return AUBIO_FAIL; } } @@ -209,9 +209,12 @@ aubio_timestretch_do (aubio_timestretch_t * p, fvec_t * out, uint_t * read) if (available >= (int)p->hopsize) { rubberband_retrieve(p->rb, (float* const*)&(out->data), p->hopsize); *read = p->hopsize; - } else { + } else if (available > 0) { rubberband_retrieve(p->rb, (float* const*)&(out->data), available); *read = available; + } else { + fvec_zeros(out); + *read = 0; } } -- 2.11.0