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

View File

@@ -758,28 +758,22 @@ Track::set_align_choice_from_io ()
if (_input) { if (_input) {
uint32_t n = 0; uint32_t n = 0;
vector<string> connections;
boost::shared_ptr<Port> p; boost::shared_ptr<Port> p;
while (true) { while (0 != (p = _input->nth (n++))) {
/* In case of JACK all ports not owned by Ardour may be re-sampled,
p = _input->nth (n++); * and latency is added. external JACK ports need to be treated
* like physical ports: I/O latency needs to be taken into account.
if (!p) { *
* When not using JACK, all external ports are physical ports.
*/
if (p->externally_connected ()) {
have_physical = true;
break; 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 * Click-out is aligned to output and hence
* equivalent to a physical round-trip alike * equivalent to a physical round-trip alike
* ExistingMaterial. * ExistingMaterial.