From 320fb2f7fe8dad67916f0d2b47faff997015f7c9 Mon Sep 17 00:00:00 2001 From: Chris Cannam Date: Mon, 20 Feb 2023 15:25:27 +0000 Subject: [PATCH] Ensure we consume when called with final=true and no samples - this was the default behaviour in R2 and also initially in R3 but changed when resample-before modes were added --- src/finer/R3Stretcher.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/finer/R3Stretcher.cpp b/src/finer/R3Stretcher.cpp index 36da6b0..e56f3d2 100644 --- a/src/finer/R3Stretcher.cpp +++ b/src/finer/R3Stretcher.cpp @@ -679,7 +679,13 @@ R3Stretcher::process(const float *const *input, size_t samples, bool final) int channels = m_parameters.channels; int inputIx = 0; - while (inputIx < int(samples)) { + if (samples == 0 && final) { + + m_log.log(2, "process: no samples but final specified, consuming"); + + consume(); + + } else while (inputIx < int(samples)) { int remaining = int(samples) - inputIx; int ws = m_channelData[0]->inbuf->getWriteSpace();