From a556e96ed06cf5d4555d02905c2357cdab0304a3 Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Mon, 16 Aug 2021 22:19:36 +0200 Subject: [PATCH] Fix latency report for unconnected tracks When a track's output is not connected, its alignment can /float/. Previously it assumed the worst (compensate for worst-case latency). The track itself has no playback latency, so any send would delay the 'thru' path to match the send's playback latency. This resulted in the track reporting a non-zero latency which is not really present, nor relevant. --- libs/ardour/route.cc | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/libs/ardour/route.cc b/libs/ardour/route.cc index ab3aac3894..54ca2e6993 100644 --- a/libs/ardour/route.cc +++ b/libs/ardour/route.cc @@ -4290,7 +4290,13 @@ Route::update_signal_latency (bool apply_to_delayline, bool* delayline_update_ne samplecnt_t capt_lat_in = _input->connected_latency (false); samplecnt_t play_lat_out = _output->connected_latency (true); samplecnt_t in_latency = _input->latency (); - _output_latency = _output->latency (); + + /* When the track's output is not connected, align it to master-out. + * Effectively we want to configure all latent-sends to not introduce any latency. + * Since the output is not used, Send::_thru_delay is not relevant, and + * Send->effective_latency () should return zero. + */ + _output_latency = _output->connected () ? _output->latency () : (_session.master_out() ? _session.master_out()->output ()->latency () : 0); Glib::Threads::RWLock::ReaderLock lm (_processor_lock);