From 2b139ead8d75b3acced1d5f7b027bc44f3126408 Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Tue, 22 Sep 2020 21:55:49 +0200 Subject: [PATCH] Cache route's output playback latency IO::latency iterates over the port-set retrieving the private_latency_range of each port. The value can cached since it can only change when connections or latency changes. see also 40eefeddd666e --- libs/ardour/route.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libs/ardour/route.cc b/libs/ardour/route.cc index 65c82b4d79..ffae44b893 100644 --- a/libs/ardour/route.cc +++ b/libs/ardour/route.cc @@ -425,7 +425,7 @@ Route::process_output_buffers (BufferSet& bufs, bool run_disk_writer = false; if (_disk_writer && speed > 0) { samplecnt_t latency_preroll = _session.remaining_latency_preroll (); - run_disk_writer = latency_preroll < nframes + (_signal_latency + _output->latency ()); + run_disk_writer = latency_preroll < nframes + (_signal_latency + _output_latency); if (end_sample - _disk_writer->input_latency () < _session.transport_sample ()) { run_disk_writer = true; } @@ -3886,7 +3886,7 @@ Route::playback_latency (bool incl_downstream) const if (incl_downstream) { rv += _output->connected_latency (true); } else { - rv += _output->latency (); + rv += _output_latency; } return rv; }