Fix edge-case pre-roll required for looping

This is mainly for the benefit of Mixbus, where input_latency
is not propagated upwards from the master bus (no direct
connection).

In Ardour's case _worst_input_latency >= _worst_route_latency
unless a given track with latent plugin is not connected.

Previously looping became out of sync (normal playback was not
affected) when a track had a latent plugin.
This commit is contained in:
Robin Gareus 2024-08-14 21:50:04 +02:00
parent 803ff507ab
commit 8a8ae7069e
No known key found for this signature in database
GPG key ID: A090BCE02CF57F04

View file

@ -1728,7 +1728,7 @@ Session::worst_latency_preroll () const
samplecnt_t
Session::worst_latency_preroll_buffer_size_ceil () const
{
return lrintf (ceil ((_worst_output_latency + _worst_input_latency) / (float) current_block_size) * current_block_size);
return lrintf (ceil ((_worst_output_latency + max (_worst_route_latency, _worst_input_latency)) / (float) current_block_size) * current_block_size);
}
void