From d8f4e5d37694769ae9471fe47a6ebeac91d5b7bc Mon Sep 17 00:00:00 2001 From: nedko Date: Sun, 31 May 2009 12:36:33 +0000 Subject: [PATCH] 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 ddd38f542c3f744ac6e5bbec48480742102d0252) git-svn-id: http://subversion.jackaudio.org/jack/jack2/trunk/jackmp@3556 0c269be4-1314-0410-8aa9-9f06e86f4224 --- common/JackEngine.cpp | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/common/JackEngine.cpp b/common/JackEngine.cpp index 95db61dc..65382e78 100644 --- a/common/JackEngine.cpp +++ b/common/JackEngine.cpp @@ -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) {