Commit 84b20ca1 authored by sletz's avatar sletz
Browse files

Notify ports unregistration in JackEngine::ClientCloseAux.

git-svn-id: http://subversion.jackaudio.org/jack/jack2/trunk/jackmp@1849 0c269be4-1314-0410-8aa9-9f06e86f4224
parent 89952a39
......@@ -19,7 +19,9 @@ Tim Blechmann
2008-02-12 Stephane Letz <letz@grame.fr>
* Fix in JackClient::Error(): when RT thread is failing and calling Shutdown, Shutdown was not desactivating the client correctly. Thanks Esben Stien for helping finding this bug.
* Fix in JackClient::Error(): when RT thread is failing and calling Shutdown, Shutdown was not desactivating the client correctly.
* Notify ports unregistration in JackEngine::ClientCloseAux.
* Thanks Esben Stien for helping finding these bugs.
2008-02-11 Stephane Letz <letz@grame.fr>
......
......@@ -561,7 +561,25 @@ int JackEngine::ClientCloseAux(int refnum, JackClientInterface* client, bool wai
// Remove the client from the table
ReleaseRefnum(refnum);
// Remove ports
// Remove ports : notiy unregister then remove all ports
jack_int_t input[PORT_NUM_FOR_CLIENT];
fGraphManager->GetInputPorts(refnum, input);
for (int i = 0; i < PORT_NUM_FOR_CLIENT; i++) {
if (input[i] != EMPTY)
NotifyPortRegistation(input[i], false);
else
break;
}
jack_int_t output[PORT_NUM_FOR_CLIENT];
fGraphManager->GetInputPorts(refnum, output);
for (int i = 0; i < PORT_NUM_FOR_CLIENT; i++) {
if (output[i] != EMPTY)
NotifyPortRegistation(output[i], false);
else
break;
}
fGraphManager->RemoveAllPorts(refnum);
// Wait until next cycle to be sure client is not used anymore
......
......@@ -354,6 +354,22 @@ int JackGraphManager::ReleasePort(int refnum, jack_port_id_t port_index)
return res;
}
void JackGraphManager::GetInputPorts(int refnum, jack_int_t* res)
{
JackConnectionManager* manager = WriteNextStateStart();
const jack_int_t* input = manager->GetInputPorts(refnum);
memcpy(res, input, sizeof(jack_int_t) * PORT_NUM_FOR_CLIENT);
WriteNextStateStop();
}
void JackGraphManager::GetOutputPorts(int refnum, jack_int_t* res)
{
JackConnectionManager* manager = WriteNextStateStart();
const jack_int_t* output = manager->GetOutputPorts(refnum);
memcpy(res, output, sizeof(jack_int_t) * PORT_NUM_FOR_CLIENT);
WriteNextStateStop();
}
// Server
void JackGraphManager::RemoveAllPorts(int refnum)
{
......
......@@ -62,6 +62,8 @@ class JackGraphManager : public JackShmMem, public JackAtomicState<JackConnectio
// Ports management
jack_port_id_t AllocatePort(int refnum, const char* port_name, const char* port_type, JackPortFlags flags, jack_nframes_t buffer_size);
int ReleasePort(int refnum, jack_port_id_t port_index);
void GetInputPorts(int refnum, jack_int_t* res);
void GetOutputPorts(int refnum, jack_int_t* res);
void RemoveAllPorts(int refnum);
void DisconnectAllPorts(int refnum);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment