From 8a8ae7069ef8909ed79c54df44eb30784da9aecb Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Wed, 14 Aug 2024 21:50:04 +0200 Subject: [PATCH] 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. --- libs/ardour/session_transport.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libs/ardour/session_transport.cc b/libs/ardour/session_transport.cc index a965c127cf..354f38e7a4 100644 --- a/libs/ardour/session_transport.cc +++ b/libs/ardour/session_transport.cc @@ -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