Skip to content
Snippets Groups Projects
Commit d8f4e5d3 authored by nedko's avatar nedko
Browse files

When disconnect of all ports is requested, disconnect ports one by one

 * This improves notifications
 * Allows no-self-connect code to be hooked to single place in disconnect code.
(cherry picked from commit ddd38f54)

git-svn-id: http://subversion.jackaudio.org/jack/jack2/trunk/jackmp@3556 0c269be4-1314-0410-8aa9-9f06e86f4224
parent 6e1e12b0
No related branches found
No related tags found
No related merge requests found
......@@ -803,21 +803,23 @@ int JackEngine::PortDisconnect(int refnum, jack_port_id_t src, jack_port_id_t ds
jack_int_t connections[CONNECTION_NUM_FOR_PORT];
fGraphManager->GetConnections(src, connections);
// Notifications
JackPort* port = fGraphManager->GetPort(src);
int ret = 0;
if (port->GetFlags() & JackPortIsOutput) {
for (int i = 0; (i < CONNECTION_NUM_FOR_PORT) && (connections[i] != EMPTY); i++) {
jack_log("NotifyPortConnect src = %ld dst = %ld false", src, connections[i]);
NotifyPortConnect(src, connections[i], false);
if (PortDisconnect(refnum, src, connections[i]) != 0) {
ret = -1;
}
}
} else {
for (int i = 0; (i < CONNECTION_NUM_FOR_PORT) && (connections[i] != EMPTY); i++) {
jack_log("NotifyPortConnect src = %ld dst = %ld false", connections[i], src);
NotifyPortConnect(connections[i], src, false);
if (PortDisconnect(refnum, connections[i], src) != 0) {
ret = -1;
}
}
}
return fGraphManager->DisconnectAll(src);
return ret;
} else if (fGraphManager->CheckPorts(src, dst) < 0) {
return -1;
} else if (fGraphManager->Disconnect(src, dst) == 0) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment