diff --git a/ChangeLog b/ChangeLog index 734cdf8f..23886f27 100644 --- a/ChangeLog +++ b/ChangeLog @@ -2,6 +2,10 @@ Jackdmp changes log --------------------------- +2007-04-01 Stephane Letz + + * Merge JackGraphManager Remove and Release method in a unique Release method. + 2007-03-04 Stephane Letz * Dmitry Baikov patch for JackGraphManager.cpp. diff --git a/common/JackAudioDriver.cpp b/common/JackAudioDriver.cpp index c64b5cbb..967eab78 100644 --- a/common/JackAudioDriver.cpp +++ b/common/JackAudioDriver.cpp @@ -122,13 +122,13 @@ int JackAudioDriver::Detach() JackLog("JackAudioDriver::Detach\n"); for (i = 0; i < fCaptureChannels; i++) { - fGraphManager->RemovePort(fClientControl->fRefNum, fCapturePortList[i]); + fGraphManager->ReleasePort(fClientControl->fRefNum, fCapturePortList[i]); } for (i = 0; i < fPlaybackChannels; i++) { - fGraphManager->RemovePort(fClientControl->fRefNum, fPlaybackPortList[i]); + fGraphManager->ReleasePort(fClientControl->fRefNum, fPlaybackPortList[i]); if (fWithMonitorPorts) - fGraphManager->RemovePort(fClientControl->fRefNum, fMonitorPortList[i]); + fGraphManager->ReleasePort(fClientControl->fRefNum, fMonitorPortList[i]); } return 0; diff --git a/common/JackEngine.cpp b/common/JackEngine.cpp index 607ca29c..df27befa 100644 --- a/common/JackEngine.cpp +++ b/common/JackEngine.cpp @@ -560,8 +560,7 @@ int JackEngine::PortUnRegister(int refnum, jack_port_id_t port_index) JackLog("JackEngine::PortUnRegister ref = %ld port_index = %ld\n", refnum, port_index); assert(fClientTable[refnum]); - if (fGraphManager->RemovePort(refnum, port_index) == 0) { - fGraphManager->ReleasePort(port_index); + if (fGraphManager->ReleasePort(refnum, port_index) == 0) { NotifyPortRegistation(port_index, false); return 0; } else { diff --git a/common/JackGraphManager.cpp b/common/JackGraphManager.cpp index 290761d9..be1f3fc8 100644 --- a/common/JackGraphManager.cpp +++ b/common/JackGraphManager.cpp @@ -310,14 +310,16 @@ jack_port_id_t JackGraphManager::AllocatePort(int refnum, const char* port_name, } // Server +/* void JackGraphManager::ReleasePort(jack_port_id_t port_index) { JackPort* port = GetPort(port_index); port->Release(); } +*/ // Server -int JackGraphManager::RemovePort(int refnum, jack_port_id_t port_index) +int JackGraphManager::ReleasePort(int refnum, jack_port_id_t port_index) { JackConnectionManager* manager = WriteNextStateStart(); JackPort* port = GetPort(port_index); @@ -331,6 +333,7 @@ int JackGraphManager::RemovePort(int refnum, jack_port_id_t port_index) res = manager->RemoveInputPort(refnum, port_index); } + port->Release(); WriteNextStateStop(); return res; } @@ -345,15 +348,13 @@ void JackGraphManager::RemoveAllPorts(int refnum) // Warning : RemovePort shift port to left, thus we always remove the first port until the "input" table is empty const jack_int_t* input = manager->GetInputPorts(refnum); while ((port_index = input[0]) != EMPTY) { - RemovePort(refnum, port_index); - ReleasePort(port_index); + ReleasePort(refnum, port_index); } // Warning : RemovePort shift port to left, thus we always remove the first port until the "output" table is empty const jack_int_t* output = manager->GetOutputPorts(refnum); while ((port_index = output[0]) != EMPTY) { - RemovePort(refnum, port_index); - ReleasePort(port_index); + ReleasePort(refnum, port_index); } WriteNextStateStop(); diff --git a/common/JackGraphManager.h b/common/JackGraphManager.h index 646e0267..3cf0d928 100644 --- a/common/JackGraphManager.h +++ b/common/JackGraphManager.h @@ -58,7 +58,10 @@ class JackGraphManager : public JackShmMem, public JackAtomicState