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.
This commit is contained in:
Robin Gareus 2019-10-01 13:42:34 +02:00
parent 07905f0776
commit ec2628f2ca
No known key found for this signature in database
GPG key ID: A090BCE02CF57F04

View file

@ -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);