From 9091838b82f803ae35ec7faebdac39d0fbd6b606 Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Wed, 8 Jan 2020 00:40:18 +0100 Subject: [PATCH] Fix MIDI Port-latencies Only audio ports have additional latency due to I/O re-sampling for vari-speed playback/capture.. MIDI ports are not affected. --- libs/ardour/port.cc | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/libs/ardour/port.cc b/libs/ardour/port.cc index a8e80ad98c..5c1766f931 100644 --- a/libs/ardour/port.cc +++ b/libs/ardour/port.cc @@ -365,8 +365,10 @@ Port::set_public_latency_range (LatencyRange const& range, bool playback) const r.min *= _speed_ratio; r.max *= _speed_ratio; #endif - r.min += (_resampler_quality - 1); - r.max += (_resampler_quality - 1); + if (type () == DataType::AUDIO) { + r.min += (_resampler_quality - 1); + r.max += (_resampler_quality - 1); + } } port_engine.set_latency_range (_port_handle, playback, r); } @@ -429,8 +431,10 @@ Port::public_latency_range (bool /*playback*/) const r.min /= _speed_ratio; r.max /= _speed_ratio; #endif - r.min += (_resampler_quality - 1); - r.max += (_resampler_quality - 1); + if (type () == DataType::AUDIO) { + r.min += (_resampler_quality - 1); + r.max += (_resampler_quality - 1); + } } DEBUG_TRACE (DEBUG::Latency, string_compose ( @@ -476,8 +480,10 @@ Port::get_connected_latency_range (LatencyRange& range, bool playback) const lr.min /= _speed_ratio; lr.max /= _speed_ratio; #endif - lr.min += (_resampler_quality - 1); - lr.max += (_resampler_quality - 1); + if (type () == DataType::AUDIO) { + lr.min += (_resampler_quality - 1); + lr.max += (_resampler_quality - 1); + } } DEBUG_TRACE (DEBUG::Latency, string_compose ( -- 2.30.2