From 6c0d3651cf4e87bbdaf523ab74b225fa608d135d Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Sun, 13 Mar 2022 16:29:42 +0100 Subject: [PATCH] Cont'd work on track bounce/export alignment Due to recent changes, when the master bus is disconnected its private port latency was never unset. This lead to misalignment when using stem-export if master (or monitor) output was not connected. --- libs/ardour/route.cc | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/libs/ardour/route.cc b/libs/ardour/route.cc index e9a615f0f3..0f180d867d 100644 --- a/libs/ardour/route.cc +++ b/libs/ardour/route.cc @@ -4373,7 +4373,7 @@ Route::update_signal_latency (bool apply_to_delayline, bool* delayline_update_ne * Since the output is not used, Send::_thru_delay is not relevant, and * Send->effective_latency () should return zero. */ - if (output_effectively_connected ()) { + if (is_master() || output_effectively_connected ()) { _output_latency = _output->latency (); } else if (_session.master_out ()) { /* We cannot use `_session.master_out()->input()->latency()` because that would return capture latency. @@ -5020,7 +5020,10 @@ Route::update_port_latencies (PortSet& from, PortSet& to, bool playback, samplec * So for correct alignment we use the Delivery's playback latency. */ LatencyRange outport_latency = all_connections; - if (playback && _main_outs && !connected) { + /* routes without latency delayline (master, monitor) always use the + * actual connected latency. + */ + if (playback && _main_outs && !connected && _delayline) { outport_latency.min = _main_outs->playback_offset () - _main_outs->input_latency (); outport_latency.max = _main_outs->playback_offset () - _main_outs->input_latency (); }