Commit 31925d51 authored by sletz's avatar sletz
Browse files

Fix jack_port_set_name when used with already unregistered clients.

git-svn-id: http://subversion.jackaudio.org/jack/jack2/trunk/jackmp@2858 0c269be4-1314-0410-8aa9-9f06e86f4224
parent 1274ff1d
......@@ -555,8 +555,9 @@ EXPORT int jack_port_set_name(jack_port_t* port, const char* name)
return -1;
} else {
JackGraphManager* manager = GetGraphManager();
if (manager) {
JackClient* client = JackClient::fClientTable[manager->GetPort(myport)->GetRefNum()];
int refnum;
if (manager && ((refnum = manager->GetPort(myport)->GetRefNum()) > 0)) {
JackClient* client = JackClient::fClientTable[refnum];
assert(client);
return client->PortRename(myport, name);
} else {
......
......@@ -244,7 +244,7 @@ int JackClient::ClientNotify(int refnum, const char* name, int notify, int sync,
break;
case kPortRenameCallback:
jack_log("JackClient::kPortRenameCallback src = %ld dst = %ld", value1, value2);
jack_log("JackClient::kPortRenameCallback port = %ld");
if (fPortRename)
fPortRename(value1, GetGraphManager()->GetPort(value1)->GetName(), fPortRenameArg);
break;
......
......@@ -416,7 +416,7 @@ extern "C"
*
* @return 0 on success, otherwise a non-zero error code
*/
int jack_set_port_registration_callback (jack_client_t *,
int jack_set_port_registration_callback (jack_client_t *,
JackPortRegistrationCallback
registration_callback, void *arg);
......
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