When reconnecting ports, don't give up on first failure.
If there are multiple connections, one might fail due to missing hardware, but the rest could still be valid. An easy way to reproduce this was to route "mackie control out" to a device and to the Midi tracer port. When you opened the session again, connection from the "mackie control out" to the device would not get restored because the Midi tracer port does not exist at session start. This most likely caused other issues with connections when changing backends.
This commit is contained in:
parent
30811989ef
commit
ff1d5e7aeb
@ -560,16 +560,23 @@ Port::reconnect ()
|
|||||||
{
|
{
|
||||||
/* caller must hold process lock; intended to be used only after reestablish() */
|
/* caller must hold process lock; intended to be used only after reestablish() */
|
||||||
|
|
||||||
DEBUG_TRACE (DEBUG::Ports, string_compose ("Connect %1 to %2 destinations\n",name(), _connections.size()));
|
DEBUG_TRACE (DEBUG::Ports, string_compose ("Port::reconnect() Connect %1 to %2 destinations\n",name(), _connections.size()));
|
||||||
|
|
||||||
for (std::set<string>::iterator i = _connections.begin(); i != _connections.end(); ++i) {
|
int count = 0;
|
||||||
if (connect (*i)) {
|
std::set<string>::iterator i = _connections.begin();
|
||||||
_connections.clear ();
|
|
||||||
return -1;
|
while (i != _connections.end()) {
|
||||||
|
std::set<string>::iterator current = i++;
|
||||||
|
if (connect (*current)) {
|
||||||
|
DEBUG_TRACE (DEBUG::Ports, string_compose ("Port::reconnect() failed to connect %1 to %2\n", name(), (*current)));
|
||||||
|
_connections.erase (current);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
++count;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return count == 0 ? -1 : 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** @param n Short port name (no port-system client name) */
|
/** @param n Short port name (no port-system client name) */
|
||||||
|
Loading…
Reference in New Issue
Block a user