summaryrefslogtreecommitdiff
path: root/libs/ardour/port_manager.cc
diff options
context:
space:
mode:
authorRobin Gareus <robin@gareus.org>2020-04-07 04:06:02 +0200
committerRobin Gareus <robin@gareus.org>2020-04-07 04:06:02 +0200
commit2932337a32eeea40ab9ac33c505e8dc603f45624 (patch)
tree71fff0ca6d83406de15e43d90675b36ee48d235e /libs/ardour/port_manager.cc
parente95d33502fc5abe86d5fc715fe3dd9c0fe7a008e (diff)
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.
Diffstat (limited to 'libs/ardour/port_manager.cc')
-rw-r--r--libs/ardour/port_manager.cc24
1 files 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<Ports> 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<Port> 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;
- }
}
}
}