diff options
author | Robin Gareus <robin@gareus.org> | 2020-01-08 00:40:18 +0100 |
---|---|---|
committer | Robin Gareus <robin@gareus.org> | 2020-01-08 00:40:18 +0100 |
commit | 9091838b82f803ae35ec7faebdac39d0fbd6b606 (patch) | |
tree | 62a0f050d204a7bc704d3ad15b4dab46f06d0047 /libs/ardour/port.cc | |
parent | 7f33d95937f3343b32c220aa94608cd39d602fb6 (diff) |
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.
Diffstat (limited to 'libs/ardour/port.cc')
-rw-r--r-- | libs/ardour/port.cc | 18 |
1 files 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 ( |