From ec2628f2ca1249d89b4049045a6ff05d39bf474b Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Tue, 1 Oct 2019 13:42:34 +0200 Subject: Fix thinko in cd5f70e69a (delayline buffer resize) The delay-time itself can change arbitrarily, but the buffer-size never shrinks. If the buffersize grows it means that the new delay is longer than the current one (or at least as large as any pending, not yet active delay). This is important for the mechanism that adjusts the read-pointer to the new buffer-size. --- libs/ardour/delayline.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'libs/ardour/delayline.cc') diff --git a/libs/ardour/delayline.cc b/libs/ardour/delayline.cc index 341a3b53e4..cf7b3d4364 100644 --- a/libs/ardour/delayline.cc +++ b/libs/ardour/delayline.cc @@ -322,7 +322,6 @@ void DelayLine::allocate_pending_buffers (samplecnt_t signal_delay, ChanCount const& cc) { assert (signal_delay >= 0); - assert (signal_delay >= _pending_delay); samplecnt_t rbs = signal_delay + MAX_BUFFER_SIZE + 1; rbs = std::max (_bsiz, rbs); @@ -367,6 +366,7 @@ DelayLine::allocate_pending_buffers (samplecnt_t signal_delay, ChanCount const& } } + assert (signal_delay >= _pending_delay); assert ((_roff <= (_woff + signal_delay - _pending_delay) & (rbs -1)) || offset > 0); _roff += offset; assert (_roff < rbs); -- cgit v1.2.3