From 2932337a32eeea40ab9ac33c505e8dc603f45624 Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Tue, 7 Apr 2020 04:06:02 +0200 Subject: [PATCH] Fix ambiguous latency check Only compare playback latency, delaylines in tracks do not push back the capture latency to the source. The delayline on tracks sits in between disk-writer and disk-reader, delaying input to align with the disk-reader. Furthermore tracks may be connected to different inputs, even though those inputs are usually from the same hardware device, capture latency of those ports can differ. --- libs/ardour/port_manager.cc | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/libs/ardour/port_manager.cc b/libs/ardour/port_manager.cc index 00648dda8b..841a04a4f5 100644 --- a/libs/ardour/port_manager.cc +++ b/libs/ardour/port_manager.cc @@ -1380,19 +1380,19 @@ PortManager::check_for_amibiguous_latency (bool log) const { bool rv = false; boost::shared_ptr plist = ports.reader(); - for (Ports::iterator p = plist->begin(); p != plist->end(); ++p) { - for (int c = 0; c < 1; ++c) { - LatencyRange range; - p->second->get_connected_latency_range (range, c ? true : false); - if (range.min != range.max) { - if (log) { - warning << string_compose(_("PortEngine: ambiguous %1 latency for port '%2' (%3, %4)"), - (c ? "playback" : "capture"), p->second->name(), range.min, range.max) - << endmsg; - rv = true; - } else { + for (Ports::iterator pi = plist->begin(); pi != plist->end(); ++pi) { + boost::shared_ptr const& p (pi->second); + if (! p->sends_output ()) { + continue; + } + LatencyRange range; + p->get_connected_latency_range (range, true); + if (range.min != range.max) { + if (log) { + warning << string_compose(_("Ambiguous latency for port '%1' (%2, %3)"), p->name(), range.min, range.max) << endmsg; + rv = true; + } else { return true; - } } } }