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.
This commit is contained in:
Robin Gareus 2020-05-08 01:26:47 +02:00
parent d363a1740d
commit 6afcb350c5
No known key found for this signature in database
GPG key ID: A090BCE02CF57F04

View file

@ -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.