diff options
author | Robin Gareus <robin@gareus.org> | 2020-05-08 01:26:47 +0200 |
---|---|---|
committer | Robin Gareus <robin@gareus.org> | 2020-05-08 01:26:47 +0200 |
commit | 6afcb350c5d438c79bf8a9420fc74cb3338c0383 (patch) | |
tree | 0564e1057c73c5c507274f54fda378d02eec291d /libs/ardour/track.cc | |
parent | d363a1740d6d466f7904d26b7fac169aa58ed8ae (diff) |
Fix capture alignment when using JACK
In case of JACK all ports not owned by Ardour may be re-sampled,
and latency is added. External JACK ports need to be treated
like physical ports: I/O latency needs to be taken into account.
When not using JACK, all external ports are physical ports
so this is a NO-OP for other backends.
Diffstat (limited to 'libs/ardour/track.cc')
-rw-r--r-- | libs/ardour/track.cc | 26 |
1 files changed, 10 insertions, 16 deletions
diff --git a/libs/ardour/track.cc b/libs/ardour/track.cc index 74125c2b62..3036fe52c4 100644 --- a/libs/ardour/track.cc +++ b/libs/ardour/track.cc @@ -758,28 +758,22 @@ Track::set_align_choice_from_io () if (_input) { uint32_t n = 0; - vector<string> connections; boost::shared_ptr<Port> p; - while (true) { - - p = _input->nth (n++); - - if (!p) { + while (0 != (p = _input->nth (n++))) { + /* In case of JACK all ports not owned by Ardour may be re-sampled, + * and latency is added. external JACK ports need to be treated + * like physical ports: I/O latency needs to be taken into account. + * + * When not using JACK, all external ports are physical ports. + */ + if (p->externally_connected ()) { + have_physical = true; break; } - - if (p->get_connections (connections) != 0) { - if (AudioEngine::instance()->port_is_physical (connections[0])) { - have_physical = true; - break; - } - } - - connections.clear (); } - /* Special case bounding the Metronome. + /* Special case bouncing the Metronome. * Click-out is aligned to output and hence * equivalent to a physical round-trip alike * ExistingMaterial. |