Browse Source

Fix client UUID gen, and some warnings (#440)

* Fix generation of client uuid

Signed-off-by: falkTX <falktx@falktx.com>

* Remove all client properties when removed; Cleanup a few things

Signed-off-by: falkTX <falktx@falktx.com>

* Make all uuid function arguments use jack_uuid_t type; Fix warnings

Signed-off-by: falkTX <falktx@falktx.com>

* Rework uuids to never be int, more cleanup

Signed-off-by: falkTX <falktx@falktx.com>
tags/v1.9.13
Filipe Coelho GitHub 6 years ago
parent
commit
59550f67ee
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
39 changed files with 179 additions and 156 deletions
  1. +2
    -2
      common/JackAPI.cpp
  2. +4
    -4
      common/JackChannel.h
  3. +3
    -3
      common/JackClient.cpp
  4. +1
    -1
      common/JackClient.h
  5. +6
    -6
      common/JackClientControl.h
  6. +1
    -0
      common/JackConstants.h
  7. +1
    -1
      common/JackControlAPI.cpp
  8. +1
    -1
      common/JackDebugClient.cpp
  9. +1
    -1
      common/JackDebugClient.h
  10. +3
    -2
      common/JackDriver.cpp
  11. +45
    -33
      common/JackEngine.cpp
  12. +4
    -5
      common/JackEngine.h
  13. +2
    -2
      common/JackExternalClient.cpp
  14. +1
    -1
      common/JackExternalClient.h
  15. +3
    -3
      common/JackGenericClientChannel.cpp
  16. +4
    -4
      common/JackGenericClientChannel.h
  17. +3
    -3
      common/JackInternalClient.cpp
  18. +3
    -3
      common/JackInternalClient.h
  19. +2
    -2
      common/JackInternalClientChannel.h
  20. +1
    -1
      common/JackLibClient.cpp
  21. +1
    -1
      common/JackLibClient.h
  22. +2
    -2
      common/JackLockedEngine.h
  23. +1
    -1
      common/JackNetTool.cpp
  24. +37
    -37
      common/JackRequest.h
  25. +3
    -3
      common/JackServer.cpp
  26. +3
    -3
      common/JackServer.h
  27. +6
    -4
      common/varargs.h
  28. +1
    -0
      common/wscript
  29. +5
    -7
      dbus/controller_iface_patchbay.c
  30. +3
    -1
      dbus/sigsegv.c
  31. +4
    -0
      example-clients/netsource.c
  32. +6
    -6
      example-clients/property.c
  33. +4
    -1
      linux/JackLinuxFutex.cpp
  34. +7
    -7
      linux/alsarawmidi/JackALSARawMidiDriver.cpp
  35. +1
    -1
      linux/firewire/ffado_driver.h
  36. +1
    -1
      posix/JackSocketClientChannel.cpp
  37. +1
    -1
      posix/JackSocketClientChannel.h
  38. +1
    -1
      windows/JackWinNamedPipeClientChannel.cpp
  39. +1
    -1
      windows/JackWinNamedPipeClientChannel.h

+ 2
- 2
common/JackAPI.cpp View File

@@ -1982,8 +1982,8 @@ LIB_EXPORT char *jack_client_get_uuid(jack_client_t* ext_client)
jack_error("jack_client_get_uuid called with a NULL client");
return NULL;
} else {
char retval[16];
snprintf(retval, sizeof(retval), "%d", client->GetClientControl()->fSessionID);
char retval[JACK_UUID_STRING_SIZE];
jack_uuid_unparse(client->GetClientControl()->fSessionID, retval);
return strdup(retval);
}
}


+ 4
- 4
common/JackChannel.h View File

@@ -99,7 +99,7 @@ class JackClientChannelInterface
{}

// Open the Server/Client connection
virtual int Open(const char* server_name, const char* name, int uuid, char* name_res, JackClient* obj, jack_options_t options, jack_status_t* status)
virtual int Open(const char* server_name, const char* name, jack_uuid_t uuid, char* name_res, JackClient* obj, jack_options_t options, jack_status_t* status)
{
return 0;
}
@@ -123,9 +123,9 @@ class JackClientChannelInterface
return -1;
}

virtual void ClientCheck(const char* name, int uuid, char* name_res, int protocol, int options, int* status, int* result, int open)
virtual void ClientCheck(const char* name, jack_uuid_t uuid, char* name_res, int protocol, int options, int* status, int* result, int open)
{}
virtual void ClientOpen(const char* name, int pid, int uuid, int* shared_engine, int* shared_client, int* shared_graph, int* result)
virtual void ClientOpen(const char* name, int pid, jack_uuid_t uuid, int* shared_engine, int* shared_client, int* shared_graph, int* result)
{}
virtual void ClientOpen(const char* name, int* ref, JackEngineControl** shared_engine, JackGraphManager** shared_manager, JackClientInterface* client, int* result)
{}
@@ -169,7 +169,7 @@ class JackClientChannelInterface
{}
virtual void InternalClientHandle(int refnum, const char* client_name, int* status, int* int_ref, int* result)
{}
virtual void InternalClientLoad(int refnum, const char* client_name, const char* so_name, const char* objet_data, int options, int* status, int* int_ref, int uuid, int* result)
virtual void InternalClientLoad(int refnum, const char* client_name, const char* so_name, const char* objet_data, int options, int* status, int* int_ref, jack_uuid_t uuid, int* result)
{}
virtual void InternalClientUnload(int refnum, int int_ref, int* status, int* result)
{}


+ 3
- 3
common/JackClient.cpp View File

@@ -304,12 +304,12 @@ int JackClient::ClientNotify(int refnum, const char* name, int notify, int sync,
jack_log("JackClient::kSessionCallback");
if (fSession) {
jack_session_event_t* event = (jack_session_event_t*)malloc( sizeof(jack_session_event_t));
char uuid_buf[JACK_UUID_SIZE];
char uuid_buf[JACK_UUID_STRING_SIZE];
event->type = (jack_session_event_type_t)value1;
event->session_dir = strdup(message);
event->command_line = NULL;
event->flags = (jack_session_flags_t)0;
snprintf(uuid_buf, sizeof(uuid_buf), "%d", GetClientControl()->fSessionID);
jack_uuid_unparse(GetClientControl()->fSessionID, uuid_buf);
event->client_uuid = strdup(uuid_buf);
fSessionReply = kPendingSessionReply;
// Session callback may change fSessionReply by directly using jack_session_reply
@@ -1306,7 +1306,7 @@ int JackClient::SessionReply(jack_session_event_t* ev)

char* JackClient::GetUUIDForClientName(const char* client_name)
{
char uuid_res[JACK_UUID_SIZE];
char uuid_res[JACK_UUID_STRING_SIZE];
int result = -1;
fChannel->GetUUIDForClientName(GetClientControl()->fRefNum, client_name, uuid_res, &result);
return (result) ? NULL : strdup(uuid_res);


+ 1
- 1
common/JackClient.h View File

@@ -131,7 +131,7 @@ class SERVER_EXPORT JackClient : public JackClientInterface, public JackRunnable
JackClient(JackSynchro* table);
virtual ~JackClient();

virtual int Open(const char* server_name, const char* name, int uuid, jack_options_t options, jack_status_t* status) = 0;
virtual int Open(const char* server_name, const char* name, jack_uuid_t uuid, jack_options_t options, jack_status_t* status) = 0;
virtual int Close();

virtual JackGraphManager* GetGraphManager() const = 0;


+ 6
- 6
common/JackClientControl.h View File

@@ -46,26 +46,26 @@ struct JackClientControl : public JackShmMemAble
int fPID;
bool fActive;

int fSessionID;
jack_uuid_t fSessionID;
char fSessionCommand[JACK_SESSION_COMMAND_SIZE];
jack_session_flags_t fSessionFlags;

JackClientControl(const char* name, int pid, int refnum, int uuid)
JackClientControl(const char* name, int pid, int refnum, jack_uuid_t uuid)
{
Init(name, pid, refnum, uuid);
}

JackClientControl(const char* name)
JackClientControl(const char* name, jack_uuid_t uuid)
{
Init(name, 0, -1, -1);
Init(name, 0, -1, uuid);
}

JackClientControl()
{
Init("", 0, -1, -1);
Init("", 0, -1, JACK_UUID_EMPTY_INITIALIZER);
}

void Init(const char* name, int pid, int refnum, int uuid)
void Init(const char* name, int pid, int refnum, jack_uuid_t uuid)
{
strcpy(fName, name);
for (int i = 0; i < kMaxNotification; i++) {


+ 1
- 0
common/JackConstants.h View File

@@ -36,6 +36,7 @@
#define JACK_MESSAGE_SIZE 256
#define JACK_UUID_SIZE 36 // to match jack1 and uuid.h
#define JACK_UUID_STRING_SIZE (JACK_UUID_SIZE+1) /* includes trailing null */
#define JACK_UUID_EMPTY_INITIALIZER 0
#define JACK_SESSION_COMMAND_SIZE 256

#define SYNC_MAX_NAME_SIZE 256


+ 1
- 1
common/JackControlAPI.cpp View File

@@ -1070,7 +1070,7 @@ jackctl_server_open(

return true;

} catch (std::exception e) {
} catch (std::exception&) {
jack_error("jackctl_server_open error...");
jackctl_destroy_param_list(paramlist);
}


+ 1
- 1
common/JackDebugClient.cpp View File

@@ -79,7 +79,7 @@ JackDebugClient::~JackDebugClient()
delete fClient;
}

int JackDebugClient::Open(const char* server_name, const char* name, int uuid, jack_options_t options, jack_status_t* status)
int JackDebugClient::Open(const char* server_name, const char* name, jack_uuid_t uuid, jack_options_t options, jack_status_t* status)
{
int res = fClient->Open(server_name, name, uuid, options, status);
char provstr[256];


+ 1
- 1
common/JackDebugClient.h View File

@@ -68,7 +68,7 @@ class JackDebugClient : public JackClient
JackDebugClient(JackClient* fTheClient);
virtual ~JackDebugClient();

virtual int Open(const char* server_name, const char* name, int uuid, jack_options_t options, jack_status_t* status);
virtual int Open(const char* server_name, const char* name, jack_uuid_t uuid, jack_options_t options, jack_status_t* status);
int Close();

virtual JackGraphManager* GetGraphManager() const;


+ 3
- 2
common/JackDriver.cpp View File

@@ -40,8 +40,9 @@ namespace Jack
JackDriver::JackDriver(const char* name, const char* alias, JackLockedEngine* engine, JackSynchro* table)
:fCaptureChannels(0),
fPlaybackChannels(0),
fClientControl(name),
fWithMonitorPorts(false){
fClientControl(name, jack_client_uuid_generate()),
fWithMonitorPorts(false)
{
assert(strlen(name) < JACK_CLIENT_NAME_SIZE);
fSynchroTable = table;
strcpy(fAliasName, alias);


+ 45
- 33
common/JackEngine.cpp View File

@@ -42,7 +42,8 @@ JackEngine::JackEngine(JackGraphManager* manager,
JackEngineControl* control,
char self_connect_mode)
: JackLockAble(control->fServerName),
fSignal(control->fServerName)
fSignal(control->fServerName),
fMetadata(NULL) // FIXME use control->fServerName?
{
fGraphManager = manager;
fSynchroTable = table;
@@ -52,7 +53,6 @@ JackEngine::JackEngine(JackGraphManager* manager,
fClientTable[i] = NULL;
}
fLastSwitchUsecs = 0;
fMaxUUID = 0;
fSessionPendingReplies = 0;
fSessionTransaction = NULL;
fSessionResult = NULL;
@@ -476,7 +476,7 @@ int JackEngine::InternalClientUnload(int refnum, int* status)
// Client management
//-------------------

int JackEngine::ClientCheck(const char* name, int uuid, char* name_res, int protocol, int options, int* status)
int JackEngine::ClientCheck(const char* name, jack_uuid_t uuid, char* name_res, int protocol, int options, int* status)
{
// Clear status
*status = 0;
@@ -564,21 +564,17 @@ bool JackEngine::ClientCheckName(const char* name)
return false;
}

int JackEngine::GetNewUUID()
void JackEngine::EnsureUUID(jack_uuid_t uuid)
{
return fMaxUUID++;
}

void JackEngine::EnsureUUID(int uuid)
{
if (uuid > fMaxUUID) {
fMaxUUID = uuid + 1;
}
if (jack_uuid_empty(uuid))
return;

for (int i = 0; i < CLIENT_NUM; i++) {
JackClientInterface* client = fClientTable[i];
if (client && (client->GetClientControl()->fSessionID == uuid)) {
client->GetClientControl()->fSessionID = GetNewUUID();
if (client && jack_uuid_compare(client->GetClientControl()->fSessionID, uuid) == 0) {
// FIXME? this code does nothing, but jack1 has it like this too..
jack_uuid_clear (&uuid);
// client->GetClientControl()->fSessionID = jack_client_uuid_generate();
}
}
}
@@ -608,12 +604,12 @@ int JackEngine::GetClientRefNum(const char* name)
}

// Used for external clients
int JackEngine::ClientExternalOpen(const char* name, int pid, int uuid, int* ref, int* shared_engine, int* shared_client, int* shared_graph_manager)
int JackEngine::ClientExternalOpen(const char* name, int pid, jack_uuid_t uuid, int* ref, int* shared_engine, int* shared_client, int* shared_graph_manager)
{
char real_name[JACK_CLIENT_NAME_SIZE + 1];

if (uuid < 0) {
uuid = GetNewUUID();
if (jack_uuid_empty(uuid)) {
uuid = jack_client_uuid_generate();
strncpy(real_name, name, JACK_CLIENT_NAME_SIZE);
} else {
std::map<int, std::string>::iterator res = fReservationMap.find(uuid);
@@ -744,6 +740,9 @@ int JackEngine::ClientCloseAux(int refnum, bool wait)
JackClientInterface* client = fClientTable[refnum];
fEngineControl->fTransport.ResetTimebase(refnum);

jack_uuid_t uuid = JACK_UUID_EMPTY_INITIALIZER;
jack_uuid_copy (&uuid, client->GetClientControl()->fSessionID);

// Unregister all ports ==> notifications are sent
jack_int_t ports[PORT_NUM_FOR_CLIENT];
int i;
@@ -774,6 +773,12 @@ int JackEngine::ClientCloseAux(int refnum, bool wait)
// Notify running clients
NotifyRemoveClient(client->GetClientControl()->fName, refnum);

fMetadata.RemoveProperties(NULL, uuid);
/* have to do the notification ourselves, since the client argument
to fMetadata->RemoveProperties() was NULL
*/
PropertyChangeNotify(uuid, NULL, PropertyDeleted);

// Cleanup...
fSynchroTable[refnum].Destroy();
fEngineControl->ResetRollingUsecs();
@@ -1082,8 +1087,8 @@ void JackEngine::SessionNotify(int refnum, const char *target, jack_session_even

for (int i = 0; i < CLIENT_NUM; i++) {
JackClientInterface* client = fClientTable[i];
if (client && (client->GetClientControl()->fSessionID < 0)) {
client->GetClientControl()->fSessionID = GetNewUUID();
if (client && jack_uuid_empty(client->GetClientControl()->fSessionID)) {
client->GetClientControl()->fSessionID = jack_client_uuid_generate();
}
}
fSessionResult = new JackSessionNotifyResult();
@@ -1114,8 +1119,8 @@ void JackEngine::SessionNotify(int refnum, const char *target, jack_session_even
if (result == kPendingSessionReply) {
fSessionPendingReplies += 1;
} else if (result == kImmediateSessionReply) {
char uuid_buf[JACK_UUID_SIZE];
snprintf(uuid_buf, sizeof(uuid_buf), "%d", client->GetClientControl()->fSessionID);
char uuid_buf[JACK_UUID_STRING_SIZE];
jack_uuid_unparse(client->GetClientControl()->fSessionID, uuid_buf);
fSessionResult->fCommandList.push_back(JackSessionCommand(uuid_buf,
client->GetClientControl()->fName,
client->GetClientControl()->fSessionCommand,
@@ -1139,8 +1144,8 @@ int JackEngine::SessionReply(int refnum)
{
JackClientInterface* client = fClientTable[refnum];
assert(client);
char uuid_buf[JACK_UUID_SIZE];
snprintf(uuid_buf, sizeof(uuid_buf), "%d", client->GetClientControl()->fSessionID);
char uuid_buf[JACK_UUID_STRING_SIZE];
jack_uuid_unparse(client->GetClientControl()->fSessionID, uuid_buf);
fSessionResult->fCommandList.push_back(JackSessionCommand(uuid_buf,
client->GetClientControl()->fName,
client->GetClientControl()->fSessionCommand,
@@ -1164,7 +1169,7 @@ int JackEngine::GetUUIDForClientName(const char *client_name, char *uuid_res)
JackClientInterface* client = fClientTable[i];

if (client && (strcmp(client_name, client->GetClientControl()->fName) == 0)) {
snprintf(uuid_res, JACK_UUID_SIZE, "%d", client->GetClientControl()->fSessionID);
jack_uuid_unparse(client->GetClientControl()->fSessionID, uuid_res);
return 0;
}
}
@@ -1172,8 +1177,12 @@ int JackEngine::GetUUIDForClientName(const char *client_name, char *uuid_res)
return -1;
}

int JackEngine::GetClientNameForUUID(const char *uuid, char *name_res)
int JackEngine::GetClientNameForUUID(const char *uuid_buf, char *name_res)
{
jack_uuid_t uuid;
if (jack_uuid_parse(uuid_buf, &uuid) != 0)
return -1;

for (int i = 0; i < CLIENT_NUM; i++) {
JackClientInterface* client = fClientTable[i];

@@ -1181,10 +1190,7 @@ int JackEngine::GetClientNameForUUID(const char *uuid, char *name_res)
continue;
}

char uuid_buf[JACK_UUID_SIZE];
snprintf(uuid_buf, JACK_UUID_SIZE, "%d", client->GetClientControl()->fSessionID);

if (strcmp(uuid,uuid_buf) == 0) {
if (jack_uuid_compare(client->GetClientControl()->fSessionID, uuid) == 0) {
strncpy(name_res, client->GetClientControl()->fName, JACK_CLIENT_NAME_SIZE);
return 0;
}
@@ -1193,17 +1199,23 @@ int JackEngine::GetClientNameForUUID(const char *uuid, char *name_res)
return -1;
}

int JackEngine::ReserveClientName(const char *name, const char *uuid)
int JackEngine::ReserveClientName(const char *name, const char *uuidstr)
{
jack_log("JackEngine::ReserveClientName ( name = %s, uuid = %s )", name, uuid);
jack_log("JackEngine::ReserveClientName ( name = %s, uuid = %s )", name, uuidstr);

if (ClientCheckName(name)) {
jack_log("name already taken");
return -1;
}

EnsureUUID(atoi(uuid));
fReservationMap[atoi(uuid)] = name;
jack_uuid_t uuid;
if (jack_uuid_parse(uuidstr, &uuid) != 0) {
jack_error("JackEngine::ReserveClientName invalid uuid %s", uuidstr);
return -1;
}

EnsureUUID(uuid);
fReservationMap[uuid] = name;
return 0;
}



+ 4
- 5
common/JackEngine.h View File

@@ -55,12 +55,12 @@ class SERVER_EXPORT JackEngine : public JackLockAble
JackServerNotifyChannel fChannel; /*! To communicate between the RT thread and server */
JackProcessSync fSignal;
jack_time_t fLastSwitchUsecs;
JackMetadata fMetadata;

int fSessionPendingReplies;
detail::JackChannelTransactionInterface* fSessionTransaction;
JackSessionNotifyResult* fSessionResult;
std::map<int,std::string> fReservationMap;
int fMaxUUID;

int ClientCloseAux(int refnum, bool wait);
void CheckXRun(jack_time_t callback_usecs);
@@ -87,8 +87,7 @@ class SERVER_EXPORT JackEngine : public JackLockAble
void NotifyPortRename(jack_port_id_t src, const char* old_name);
void NotifyActivate(int refnum);

int GetNewUUID();
void EnsureUUID(int uuid);
void EnsureUUID(jack_uuid_t uuid);

bool CheckClient(int refnum)
{
@@ -106,9 +105,9 @@ class SERVER_EXPORT JackEngine : public JackLockAble
int Close();

// Client management
int ClientCheck(const char* name, int uuid, char* name_res, int protocol, int options, int* status);
int ClientCheck(const char* name, jack_uuid_t uuid, char* name_res, int protocol, int options, int* status);

int ClientExternalOpen(const char* name, int pid, int uuid, int* ref, int* shared_engine, int* shared_client, int* shared_graph_manager);
int ClientExternalOpen(const char* name, int pid, jack_uuid_t uuid, int* ref, int* shared_engine, int* shared_client, int* shared_graph_manager);
int ClientInternalOpen(const char* name, int* ref, JackEngineControl** shared_engine, JackGraphManager** shared_manager, JackClientInterface* client, bool wait);

int ClientExternalClose(int refnum);


+ 2
- 2
common/JackExternalClient.cpp View File

@@ -41,7 +41,7 @@ int JackExternalClient::ClientNotify(int refnum, const char* name, int notify, i
return result;
}

int JackExternalClient::Open(const char* name, int pid, int refnum, int uuid, int* shared_client)
int JackExternalClient::Open(const char* name, int pid, int refnum, jack_uuid_t uuid, int* shared_client)
{
try {

@@ -64,7 +64,7 @@ int JackExternalClient::Open(const char* name, int pid, int refnum, int uuid, in
jack_log("JackExternalClient::Open name = %s index = %ld base = %x", name, shared_mem->GetShmIndex(), shared_mem->GetShmAddress());
return 0;

} catch (std::exception e) {
} catch (std::exception&) {
return -1;
}
}


+ 1
- 1
common/JackExternalClient.h View File

@@ -46,7 +46,7 @@ class JackExternalClient : public JackClientInterface
JackExternalClient();
virtual ~JackExternalClient();

int Open(const char* name, int pid, int refnum, int uuid, int* shared_client);
int Open(const char* name, int pid, int refnum, jack_uuid_t uuid, int* shared_client);
int Close();

int ClientNotify(int refnum, const char* name, int notify, int sync, const char* message, int value1, int value2);


+ 3
- 3
common/JackGenericClientChannel.cpp View File

@@ -97,7 +97,7 @@ void JackGenericClientChannel::ServerAsyncCall(JackRequest* req, JackResult* res
}
}

void JackGenericClientChannel::ClientCheck(const char* name, int uuid, char* name_res, int protocol, int options, int* status, int* result, int open)
void JackGenericClientChannel::ClientCheck(const char* name, jack_uuid_t uuid, char* name_res, int protocol, int options, int* status, int* result, int open)
{
JackClientCheckRequest req(name, protocol, options, uuid, open);
JackClientCheckResult res;
@@ -106,7 +106,7 @@ void JackGenericClientChannel::ClientCheck(const char* name, int uuid, char* nam
strcpy(name_res, res.fName);
}

void JackGenericClientChannel::ClientOpen(const char* name, int pid, int uuid, int* shared_engine, int* shared_client, int* shared_graph, int* result)
void JackGenericClientChannel::ClientOpen(const char* name, int pid, jack_uuid_t uuid, int* shared_engine, int* shared_client, int* shared_graph, int* result)
{
JackClientOpenRequest req(name, pid, uuid);
JackClientOpenResult res;
@@ -285,7 +285,7 @@ void JackGenericClientChannel::InternalClientHandle(int refnum, const char* clie
*status = res.fStatus;
}

void JackGenericClientChannel::InternalClientLoad(int refnum, const char* client_name, const char* so_name, const char* objet_data, int options, int* status, int* int_ref, int uuid, int* result)
void JackGenericClientChannel::InternalClientLoad(int refnum, const char* client_name, const char* so_name, const char* objet_data, int options, int* status, int* int_ref, jack_uuid_t uuid, int* result)
{
JackInternalClientLoadRequest req(refnum, client_name, so_name, objet_data, options, uuid);
JackInternalClientLoadResult res;


+ 4
- 4
common/JackGenericClientChannel.h View File

@@ -47,7 +47,7 @@ class JackGenericClientChannel : public detail::JackClientChannelInterface
JackGenericClientChannel();
virtual ~JackGenericClientChannel();

virtual int Open(const char* server_name, const char* name, int uuid, char* name_res, JackClient* obj, jack_options_t options, jack_status_t* status) { return -1; }
virtual int Open(const char* server_name, const char* name, jack_uuid_t uuid, char* name_res, JackClient* obj, jack_options_t options, jack_status_t* status) { return -1; }
virtual void Close() {}

virtual int Start() { return -1; }
@@ -55,8 +55,8 @@ class JackGenericClientChannel : public detail::JackClientChannelInterface

int ServerCheck(const char* server_name);

void ClientCheck(const char* name, int uuid, char* name_res, int protocol, int options, int* status, int* result, int open);
void ClientOpen(const char* name, int pid, int uuid, int* shared_engine, int* shared_client, int* shared_graph, int* result);
void ClientCheck(const char* name, jack_uuid_t uuid, char* name_res, int protocol, int options, int* status, int* result, int open);
void ClientOpen(const char* name, int pid, jack_uuid_t uuid, int* shared_engine, int* shared_client, int* shared_graph, int* result);
void ClientClose(int refnum, int* result);

void ClientActivate(int refnum, int is_real_time, int* result);
@@ -83,7 +83,7 @@ class JackGenericClientChannel : public detail::JackClientChannelInterface

void GetInternalClientName(int refnum, int int_ref, char* name_res, int* result);
void InternalClientHandle(int refnum, const char* client_name, int* status, int* int_ref, int* result);
void InternalClientLoad(int refnum, const char* client_name, const char* so_name, const char* objet_data, int options, int* status, int* int_ref, int uuid, int* result);
void InternalClientLoad(int refnum, const char* client_name, const char* so_name, const char* objet_data, int options, int* status, int* int_ref, jack_uuid_t uuid, int* result);
void InternalClientUnload(int refnum, int int_ref, int* status, int* result);

// Session API


+ 3
- 3
common/JackInternalClient.cpp View File

@@ -63,7 +63,7 @@ JackInternalClient::~JackInternalClient()
delete fChannel;
}

int JackInternalClient::Open(const char* server_name, const char* name, int uuid, jack_options_t options, jack_status_t* status)
int JackInternalClient::Open(const char* server_name, const char* name, jack_uuid_t uuid, jack_options_t options, jack_status_t* status)
{
int result;
jack_log("JackInternalClient::Open name = %s", name);
@@ -215,7 +215,7 @@ JackLoadableInternalClient::~JackLoadableInternalClient()
}
}

int JackLoadableInternalClient1::Open(const char* server_name, const char* name, int uuid, jack_options_t options, jack_status_t* status)
int JackLoadableInternalClient1::Open(const char* server_name, const char* name, jack_uuid_t uuid, jack_options_t options, jack_status_t* status)
{
int res = -1;

@@ -231,7 +231,7 @@ int JackLoadableInternalClient1::Open(const char* server_name, const char* name,
return res;
}

int JackLoadableInternalClient2::Open(const char* server_name, const char* name, int uuid, jack_options_t options, jack_status_t* status)
int JackLoadableInternalClient2::Open(const char* server_name, const char* name, jack_uuid_t uuid, jack_options_t options, jack_status_t* status)
{
int res = -1;



+ 3
- 3
common/JackInternalClient.h View File

@@ -46,7 +46,7 @@ class JackInternalClient : public JackClient
JackInternalClient(JackServer* server, JackSynchro* table);
virtual ~JackInternalClient();

int Open(const char* server_name, const char* name, int uuid, jack_options_t options, jack_status_t* status);
int Open(const char* server_name, const char* name, jack_uuid_t uuid, jack_options_t options, jack_status_t* status);
void ShutDown(jack_status_t code, const char* message);

JackGraphManager* GetGraphManager() const;
@@ -100,7 +100,7 @@ class JackLoadableInternalClient1 : public JackLoadableInternalClient
{}

int Init(const char* so_name);
int Open(const char* server_name, const char* name, int uuid, jack_options_t options, jack_status_t* status);
int Open(const char* server_name, const char* name, jack_uuid_t uuid, jack_options_t options, jack_status_t* status);

};

@@ -119,7 +119,7 @@ class JackLoadableInternalClient2 : public JackLoadableInternalClient
{}

int Init(const char* so_name);
int Open(const char* server_name, const char* name, int uuid, jack_options_t options, jack_status_t* status);
int Open(const char* server_name, const char* name, jack_uuid_t uuid, jack_options_t options, jack_status_t* status);

};



+ 2
- 2
common/JackInternalClientChannel.h View File

@@ -44,7 +44,7 @@ class JackInternalClientChannel : public detail::JackClientChannelInterface
virtual ~JackInternalClientChannel()
{}

void ClientCheck(const char* name, int uuid, char* name_res, int protocol, int options, int* status, int* result, int open)
void ClientCheck(const char* name, jack_uuid_t uuid, char* name_res, int protocol, int options, int* status, int* result, int open)
{
*result = fEngine->ClientCheck(name, uuid, name_res, protocol, options, status);
}
@@ -128,7 +128,7 @@ class JackInternalClientChannel : public detail::JackClientChannelInterface
*result = fEngine->InternalClientHandle(client_name, status, int_ref);
}

void InternalClientLoad(int refnum, const char* client_name, const char* so_name, const char* objet_data, int options, int* status, int* int_ref, int uuid, int* result)
void InternalClientLoad(int refnum, const char* client_name, const char* so_name, const char* objet_data, int options, int* status, int* int_ref, jack_uuid_t uuid, int* result)
{
*result = fServer->InternalClientLoad1(client_name, so_name, objet_data, options, int_ref, uuid, status);
}


+ 1
- 1
common/JackLibClient.cpp View File

@@ -91,7 +91,7 @@ JackLibClient::~JackLibClient()
delete fChannel;
}

int JackLibClient::Open(const char* server_name, const char* name, int uuid, jack_options_t options, jack_status_t* status)
int JackLibClient::Open(const char* server_name, const char* name, jack_uuid_t uuid, jack_options_t options, jack_status_t* status)
{
int shared_engine, shared_client, shared_graph, result;
bool res;


+ 1
- 1
common/JackLibClient.h View File

@@ -44,7 +44,7 @@ class JackLibClient : public JackClient
JackLibClient(JackSynchro* table);
virtual ~JackLibClient();

int Open(const char* server_name, const char* name, int uuid, jack_options_t options, jack_status_t* status);
int Open(const char* server_name, const char* name, jack_uuid_t uuid, jack_options_t options, jack_status_t* status);
void ShutDown(jack_status_t code, const char* message);

int ClientNotifyImp(int refnum, const char* name, int notify, int sync, const char* message, int value1, int value2);


+ 2
- 2
common/JackLockedEngine.h View File

@@ -109,14 +109,14 @@ class SERVER_EXPORT JackLockedEngine
}

// Client management
int ClientCheck(const char* name, int uuid, char* name_res, int protocol, int options, int* status)
int ClientCheck(const char* name, jack_uuid_t uuid, char* name_res, int protocol, int options, int* status)
{
TRY_CALL
JackLock lock(&fEngine);
return fEngine.ClientCheck(name, uuid, name_res, protocol, options, status);
CATCH_EXCEPTION_RETURN
}
int ClientExternalOpen(const char* name, int pid, int uuid, int* ref, int* shared_engine, int* shared_client, int* shared_graph_manager)
int ClientExternalOpen(const char* name, int pid, jack_uuid_t uuid, int* ref, int* shared_engine, int* shared_client, int* shared_graph_manager)
{
TRY_CALL
JackLock lock(&fEngine);


+ 1
- 1
common/JackNetTool.cpp View File

@@ -884,7 +884,7 @@ namespace Jack
for (int port_index = 0; port_index < fNPorts; port_index++) {
if (fPortBuffer[port_index]) {
int res = opus_custom_decode_float(fOpusDecoder[port_index], fCompressedBuffer[port_index], fCompressedSizesByte[port_index], fPortBuffer[port_index], ((nframes == -1) ? fPeriodSize : nframes));
if (res < 0 || res != ((nframes == -1) ? fPeriodSize : nframes)) {
if (res < 0 || res != ((nframes == -1) ? (int)fPeriodSize : nframes)) {
jack_error("opus_custom_decode_float error fCompressedSizeByte = %d res = %d", fCompressedSizesByte[port_index], res);
}
}


+ 37
- 37
common/JackRequest.h View File

@@ -161,15 +161,15 @@ struct JackClientCheckRequest : public JackRequest
char fName[JACK_CLIENT_NAME_SIZE+1];
int fProtocol;
int fOptions;
int fUUID;
int fOpen;
jack_uuid_t fUUID;

JackClientCheckRequest() : fProtocol(0), fOptions(0), fUUID(0), fOpen(0)
JackClientCheckRequest() : fProtocol(0), fOptions(0), fOpen(0), fUUID(JACK_UUID_EMPTY_INITIALIZER)
{
memset(fName, 0, sizeof(fName));
}
JackClientCheckRequest(const char* name, int protocol, int options, int uuid, int open = false)
: JackRequest(JackRequest::kClientCheck), fProtocol(protocol), fOptions(options), fUUID(uuid), fOpen(open)
JackClientCheckRequest(const char* name, int protocol, int options, jack_uuid_t uuid, int open = false)
: JackRequest(JackRequest::kClientCheck), fProtocol(protocol), fOptions(options), fOpen(open), fUUID(uuid)
{
memset(fName, 0, sizeof(fName));
snprintf(fName, sizeof(fName), "%s", name);
@@ -181,7 +181,7 @@ struct JackClientCheckRequest : public JackRequest
CheckRes(trans->Read(&fName, sizeof(fName)));
CheckRes(trans->Read(&fProtocol, sizeof(int)));
CheckRes(trans->Read(&fOptions, sizeof(int)));
CheckRes(trans->Read(&fUUID, sizeof(int)));
CheckRes(trans->Read(&fUUID, sizeof(jack_uuid_t)));
return trans->Read(&fOpen, sizeof(int));
}

@@ -191,11 +191,11 @@ struct JackClientCheckRequest : public JackRequest
CheckRes(trans->Write(&fName, sizeof(fName)));
CheckRes(trans->Write(&fProtocol, sizeof(int)));
CheckRes(trans->Write(&fOptions, sizeof(int)));
CheckRes(trans->Write(&fUUID, sizeof(int)));
CheckRes(trans->Write(&fUUID, sizeof(jack_uuid_t)));
return trans->Write(&fOpen, sizeof(int));
}

int Size() { return sizeof(fName) + 4 * sizeof(int); }
int Size() { return sizeof(fName) + 3 * sizeof(int) + sizeof(jack_uuid_t); }

};

@@ -246,14 +246,14 @@ struct JackClientOpenRequest : public JackRequest
{

int fPID;
int fUUID;
jack_uuid_t fUUID;
char fName[JACK_CLIENT_NAME_SIZE+1];

JackClientOpenRequest() : fPID(0), fUUID(0)
JackClientOpenRequest() : fPID(0), fUUID(JACK_UUID_EMPTY_INITIALIZER)
{
memset(fName, 0, sizeof(fName));
}
JackClientOpenRequest(const char* name, int pid, int uuid): JackRequest(JackRequest::kClientOpen)
JackClientOpenRequest(const char* name, int pid, jack_uuid_t uuid): JackRequest(JackRequest::kClientOpen)
{
memset(fName, 0, sizeof(fName));
snprintf(fName, sizeof(fName), "%s", name);
@@ -265,7 +265,7 @@ struct JackClientOpenRequest : public JackRequest
{
CheckSize();
CheckRes(trans->Read(&fPID, sizeof(int)));
CheckRes(trans->Read(&fUUID, sizeof(int)));
CheckRes(trans->Read(&fUUID, sizeof(jack_uuid_t)));
return trans->Read(&fName, sizeof(fName));
}

@@ -273,11 +273,11 @@ struct JackClientOpenRequest : public JackRequest
{
CheckRes(JackRequest::Write(trans, Size()));
CheckRes(trans->Write(&fPID, sizeof(int)));
CheckRes(trans->Write(&fUUID, sizeof(int)));
CheckRes(trans->Write(&fUUID, sizeof(jack_uuid_t)));
return trans->Write(&fName, sizeof(fName));
}

int Size() { return 2 * sizeof(int) + sizeof(fName); }
int Size() { return sizeof(int) + sizeof(jack_uuid_t) + sizeof(fName); }

};

@@ -1048,23 +1048,23 @@ struct JackInternalClientLoadRequest : public JackRequest
char fDllName[MAX_PATH+1];
char fLoadInitName[JACK_LOAD_INIT_LIMIT+1];
int fOptions;
int fUUID;
jack_uuid_t fUUID;

JackInternalClientLoadRequest() : fRefNum(0), fOptions(0), fUUID(0)
JackInternalClientLoadRequest() : fRefNum(0), fOptions(0), fUUID(JACK_UUID_EMPTY_INITIALIZER)
{
memset(fName, 0, sizeof(fName));
memset(fDllName, 0, sizeof(fDllName));
memset(fLoadInitName, 0, sizeof(fLoadInitName));
}
JackInternalClientLoadRequest(int refnum, const char* client_name, const char* so_name, const char* objet_data, int options, int uuid )
JackInternalClientLoadRequest(int refnum, const char* client_name, const char* so_name, const char* objet_data, int options, jack_uuid_t uuid )
: JackRequest(JackRequest::kInternalClientLoad), fRefNum(refnum), fOptions(options), fUUID(uuid)
{
memset(fName, 0, sizeof(fName));
memset(fDllName, 0, sizeof(fDllName));
memset(fLoadInitName, 0, sizeof(fLoadInitName));
snprintf(fName, sizeof(fName), "%s", client_name);
snprintf(fDllName, sizeof(fDllName), "%s", so_name);
snprintf(fLoadInitName, sizeof(fLoadInitName), "%s", objet_data);
strncpy(fName, client_name, sizeof(fName)-1);
strncpy(fDllName, so_name, sizeof(fDllName)-1);
strncpy(fLoadInitName, objet_data, sizeof(fLoadInitName)-1);
}

int Read(detail::JackChannelTransactionInterface* trans)
@@ -1074,7 +1074,7 @@ struct JackInternalClientLoadRequest : public JackRequest
CheckRes(trans->Read(&fName, sizeof(fName)));
CheckRes(trans->Read(&fDllName, sizeof(fDllName)));
CheckRes(trans->Read(&fLoadInitName, sizeof(fLoadInitName)));
CheckRes(trans->Read(&fUUID, sizeof(int)));
CheckRes(trans->Read(&fUUID, sizeof(jack_uuid_t)));
return trans->Read(&fOptions, sizeof(int));
}

@@ -1085,11 +1085,11 @@ struct JackInternalClientLoadRequest : public JackRequest
CheckRes(trans->Write(&fName, sizeof(fName)));
CheckRes(trans->Write(&fDllName, sizeof(fDllName)));
CheckRes(trans->Write(&fLoadInitName, sizeof(fLoadInitName)));
CheckRes(trans->Write(&fUUID, sizeof(int)));
CheckRes(trans->Write(&fUUID, sizeof(jack_uuid_t)));
return trans->Write(&fOptions, sizeof(int));
}

int Size() { return sizeof(int) + sizeof(fName) + sizeof(fDllName) + sizeof(fLoadInitName) + 2 * sizeof(int); }
int Size() { return sizeof(int) + sizeof(fName) + sizeof(fDllName) + sizeof(fLoadInitName) + sizeof(int) + sizeof(jack_uuid_t); }
};

/*!
@@ -1233,9 +1233,9 @@ struct JackClientNotificationRequest : public JackRequest

struct JackSessionCommand
{
char fUUID[JACK_UUID_SIZE];
char fUUID[JACK_UUID_STRING_SIZE];
char fClientName[JACK_CLIENT_NAME_SIZE+1];
char fCommand[JACK_SESSION_COMMAND_SIZE];
char fCommand[JACK_SESSION_COMMAND_SIZE+1];
jack_session_flags_t fFlags;

JackSessionCommand() : fFlags(JackSessionSaveError)
@@ -1303,8 +1303,8 @@ struct JackSessionNotifyResult : public JackResult
return 0;
}

char terminator[JACK_UUID_SIZE];
terminator[0] = '\0';
char terminator[JACK_UUID_STRING_SIZE];
memset(terminator, 0, sizeof(terminator));

CheckRes(JackResult::Write(trans));
for (std::list<JackSessionCommand>::iterator i = fCommandList.begin(); i != fCommandList.end(); i++) {
@@ -1363,11 +1363,9 @@ struct JackSessionNotifyRequest : public JackRequest
{
memset(fPath, 0, sizeof(fPath));
memset(fDst, 0, sizeof(fDst));
snprintf(fPath, sizeof(fPath), "%s", path);
fPath[JACK_MESSAGE_SIZE] = 0;
strncpy(fPath, path, sizeof(fPath)-1);
if (dst) {
snprintf(fDst, sizeof(fDst), "%s", dst);
fDst[JACK_CLIENT_NAME_SIZE] = 0;
strncpy(fDst, dst, sizeof(fDst)-1);
}
}

@@ -1435,7 +1433,7 @@ struct JackClientNameResult : public JackResult
: JackResult(result)
{
memset(fName, 0, sizeof(fName));
snprintf(fName, sizeof(fName), "%s", name);
strncpy(fName, name, sizeof(fName)-1);
}

int Read(detail::JackChannelTransactionInterface* trans)
@@ -1456,7 +1454,7 @@ struct JackClientNameResult : public JackResult

struct JackUUIDResult : public JackResult
{
char fUUID[JACK_UUID_SIZE];
char fUUID[JACK_UUID_STRING_SIZE];

JackUUIDResult(): JackResult()
{
@@ -1466,7 +1464,7 @@ struct JackUUIDResult : public JackResult
: JackResult(result)
{
memset(fUUID, 0, sizeof(fUUID));
snprintf(fUUID, sizeof(fUUID), "%s", uuid);
strncpy(fUUID, uuid, sizeof(fUUID)-1);
}

int Read(detail::JackChannelTransactionInterface* trans)
@@ -1521,7 +1519,7 @@ struct JackGetUUIDRequest : public JackRequest

struct JackGetClientNameRequest : public JackRequest
{
char fUUID[JACK_UUID_SIZE];
char fUUID[JACK_UUID_STRING_SIZE];

JackGetClientNameRequest()
{
@@ -1557,7 +1555,7 @@ struct JackReserveNameRequest : public JackRequest
{
int fRefNum;
char fName[JACK_CLIENT_NAME_SIZE+1];
char fUUID[JACK_UUID_SIZE];
char fUUID[JACK_UUID_STRING_SIZE];

JackReserveNameRequest() : fRefNum(0)
{
@@ -1697,8 +1695,10 @@ struct JackClientNotification
{
memset(fName, 0, sizeof(fName));
memset(fMessage, 0, sizeof(fMessage));
snprintf(fName, sizeof(fName), "%s", name);
snprintf(fMessage, sizeof(fMessage), "%s", message);
strncpy(fName, name, sizeof(fName)-1);
if (message) {
strncpy(fMessage, message, sizeof(fMessage)-1);
}
fSize = Size();
}



+ 3
- 3
common/JackServer.cpp View File

@@ -194,21 +194,21 @@ bool JackServer::IsRunning()
// Internal clients
//------------------

int JackServer::InternalClientLoad1(const char* client_name, const char* so_name, const char* objet_data, int options, int* int_ref, int uuid, int* status)
int JackServer::InternalClientLoad1(const char* client_name, const char* so_name, const char* objet_data, int options, int* int_ref, jack_uuid_t uuid, int* status)
{
JackLoadableInternalClient* client = new JackLoadableInternalClient1(JackServerGlobals::fInstance, GetSynchroTable(), objet_data);
assert(client);
return InternalClientLoadAux(client, so_name, client_name, options, int_ref, uuid, status);
}

int JackServer::InternalClientLoad2(const char* client_name, const char* so_name, const JSList * parameters, int options, int* int_ref, int uuid, int* status)
int JackServer::InternalClientLoad2(const char* client_name, const char* so_name, const JSList * parameters, int options, int* int_ref, jack_uuid_t uuid, int* status)
{
JackLoadableInternalClient* client = new JackLoadableInternalClient2(JackServerGlobals::fInstance, GetSynchroTable(), parameters);
assert(client);
return InternalClientLoadAux(client, so_name, client_name, options, int_ref, uuid, status);
}

int JackServer::InternalClientLoadAux(JackLoadableInternalClient* client, const char* so_name, const char* client_name, int options, int* int_ref, int uuid, int* status)
int JackServer::InternalClientLoadAux(JackLoadableInternalClient* client, const char* so_name, const char* client_name, int options, int* int_ref, jack_uuid_t uuid, int* status)
{
// Clear status
*status = 0;


+ 3
- 3
common/JackServer.h View File

@@ -60,7 +60,7 @@ class SERVER_EXPORT JackServer
JackSynchro fSynchroTable[CLIENT_NUM];
bool fFreewheel;

int InternalClientLoadAux(JackLoadableInternalClient* client, const char* so_name, const char* client_name, int options, int* int_ref, int uuid, int* status);
int InternalClientLoadAux(JackLoadableInternalClient* client, const char* so_name, const char* client_name, int options, int* int_ref, jack_uuid_t uuid, int* status);

public:

@@ -84,8 +84,8 @@ class SERVER_EXPORT JackServer
int SetFreewheel(bool onoff);

// Internals clients
int InternalClientLoad1(const char* client_name, const char* so_name, const char* objet_data, int options, int* int_ref, int uuid, int* status);
int InternalClientLoad2(const char* client_name, const char* so_name, const JSList * parameters, int options, int* int_ref, int uuid, int* status);
int InternalClientLoad1(const char* client_name, const char* so_name, const char* objet_data, int options, int* int_ref, jack_uuid_t uuid, int* status);
int InternalClientLoad2(const char* client_name, const char* so_name, const JSList * parameters, int options, int* int_ref, jack_uuid_t uuid, int* status);

// Internal session file
int LoadInternalSessionFile(const char* file);


+ 6
- 4
common/varargs.h View File

@@ -35,7 +35,7 @@ extern "C"
char *server_name; /* server name */
char *load_name; /* load module name */
char *load_init; /* initialization string */
int session_id; /* requested session_id */
jack_uuid_t session_id; /* requested session_id */
}
jack_varargs_t;

@@ -51,7 +51,6 @@ extern "C"
{
memset (va, 0, sizeof(jack_varargs_t));
va->server_name = (char*)jack_default_server_name();
va->session_id = -1;
}

static inline void jack_varargs_parse (jack_options_t options, va_list ap, jack_varargs_t *va)
@@ -70,8 +69,11 @@ extern "C"
va->load_init = va_arg(ap, char *);
if ((options & JackSessionID)) {
char *sid = va_arg(ap, char *);
if (sid)
va->session_id = atoi( sid );
if (sid) {
const long long id = atoll( sid );
if (id > 0)
va->session_id = id;
}
}
}



+ 1
- 0
common/wscript View File

@@ -250,6 +250,7 @@ def build(bld):
'JackMidiSendQueue.cpp',
'JackMidiUtil.cpp',
'JackMidiWriteQueue.cpp',
'JackMetadata.cpp',
]

if bld.env['IS_LINUX']:


+ 5
- 7
dbus/controller_iface_patchbay.c View File

@@ -1647,7 +1647,7 @@ jack_controller_port_connect_callback(
}
}

int jack_controller_port_rename_callback(jack_port_id_t port, const char * old_name, const char * new_name, void * context)
void jack_controller_port_rename_callback(jack_port_id_t port, const char * old_name, const char * new_name, void * context)
{
struct jack_graph_port * port_ptr;
const char * port_new_short_name;
@@ -1660,7 +1660,7 @@ int jack_controller_port_rename_callback(jack_port_id_t port, const char * old_n
if (port_new_short_name == NULL)
{
jack_error("renamed port new name '%s' does not contain ':' separator char", new_name);
return -1;
return;
}

port_new_short_name++; /* skip ':' separator char */
@@ -1669,7 +1669,7 @@ int jack_controller_port_rename_callback(jack_port_id_t port, const char * old_n
if (port_old_short_name == NULL)
{
jack_error("renamed port old name '%s' does not contain ':' separator char", old_name);
return -1;
return;
}

port_old_short_name++; /* skip ':' separator char */
@@ -1678,14 +1678,14 @@ int jack_controller_port_rename_callback(jack_port_id_t port, const char * old_n
if (port_ptr == NULL)
{
jack_error("renamed port '%s' not found", old_name);
return -1;
return;
}

name_buffer = strdup(port_new_short_name);
if (name_buffer == NULL)
{
jack_error("strdup() call for port name '%s' failed.", port_new_short_name);
return 1;
return;
}

free(port_ptr->name);
@@ -1702,8 +1702,6 @@ int jack_controller_port_rename_callback(jack_port_id_t port, const char * old_n
port_ptr->name);
jack_controller_patchbay_send_signal_graph_changed(patchbay_ptr->graph.version);
pthread_mutex_unlock(&patchbay_ptr->lock);

return 0;
}

#undef controller_ptr


+ 3
- 1
dbus/sigsegv.c View File

@@ -61,10 +61,12 @@ static void signal_segv(int signum, siginfo_t* info, void*ptr)
static void signal_segv(int signum, siginfo_t* info, void*ptr) {
static const char *si_codes[3] = {"", "SEGV_MAPERR", "SEGV_ACCERR"};

size_t i;
const char *si_code_str;
ucontext_t *ucontext = (ucontext_t*)ptr;

#if defined(HAVE_UCONTEXT) && defined(HAVE_NGREG)
size_t i;
#endif
#if defined(SIGSEGV_STACK_X86) || defined(SIGSEGV_STACK_IA64)
int f = 0;
Dl_info dlinfo;


+ 4
- 0
example-clients/netsource.c View File

@@ -62,6 +62,10 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
#include <celt/celt.h>
#endif

#ifndef CUSTOM_MODES
#define CUSTOM_MODES // for opus_custom_decoder_init
#endif

#if HAVE_OPUS
#include <opus/opus.h>
#include <opus/opus_custom.h>


+ 6
- 6
example-clients/property.c View File

@@ -11,8 +11,8 @@

static int subject_is_client = 0;
static int subject_is_port = 0;
static jack_uuid_t uuid;
static char* subject;
static jack_uuid_t uuid = JACK_UUID_EMPTY_INITIALIZER;
static char* subject = NULL;

static void
show_usage (void)
@@ -46,7 +46,7 @@ get_subject (jack_client_t* client, char* argv[], int* optind)
}

if (jack_uuid_parse (ustr, &uuid)) {
fprintf (stderr, "cannot parse client UUID as UUID\n");
fprintf (stderr, "cannot parse client UUID as UUID '%s' '%s'\n", cstr, ustr);
return -1;
}

@@ -289,13 +289,13 @@ int main (int argc, char* argv[])
/* list all properties */

jack_description_t* description;
size_t cnt;
int cnt;
size_t p;
size_t n;
int n;
char buf[JACK_UUID_STRING_SIZE];

if ((cnt = jack_get_all_properties (&description)) < 0) {
fprintf (stderr, "could not retrieve properties for %s\n", subject);
fprintf (stderr, "could not retrieve all properties\n");
exit (1);
}



+ 4
- 1
linux/JackLinuxFutex.cpp View File

@@ -138,7 +138,10 @@ bool JackLinuxFutex::Allocate(const char* name, const char* server_name, int val
return false;
}

ftruncate(fSharedMem, sizeof(FutexData));
if (ftruncate(fSharedMem, sizeof(FutexData)) != 0) {
jack_error("Allocate: can't set shared memory size in named futex name = %s err = %s", fName, strerror(errno));
return false;
}

if (fPromiscuous && (jack_promiscuous_perms(fSharedMem, fName, fPromiscuousGid) < 0)) {
close(fSharedMem);


+ 7
- 7
linux/alsarawmidi/JackALSARawMidiDriver.cpp View File

@@ -408,7 +408,7 @@ JackALSARawMidiDriver::Open(bool capturing, bool playing, int in_channels,
if (potential_inputs) {
try {
input_ports = new JackALSARawMidiInputPort *[potential_inputs];
} catch (std::exception e) {
} catch (std::exception& e) {
jack_error("JackALSARawMidiDriver::Open - while creating input "
"port array: %s", e.what());
FreeDeviceInfo(&in_info_list, &out_info_list);
@@ -418,7 +418,7 @@ JackALSARawMidiDriver::Open(bool capturing, bool playing, int in_channels,
if (potential_outputs) {
try {
output_ports = new JackALSARawMidiOutputPort *[potential_outputs];
} catch (std::exception e) {
} catch (std::exception& e) {
jack_error("JackALSARawMidiDriver::Open - while creating output "
"port array: %s", e.what());
FreeDeviceInfo(&in_info_list, &out_info_list);
@@ -430,7 +430,7 @@ JackALSARawMidiDriver::Open(bool capturing, bool playing, int in_channels,
try {
input_ports[num_inputs] = new JackALSARawMidiInputPort(info, i);
num_inputs++;
} catch (std::exception e) {
} catch (std::exception& e) {
jack_error("JackALSARawMidiDriver::Open - while creating new "
"JackALSARawMidiInputPort: %s", e.what());
}
@@ -441,7 +441,7 @@ JackALSARawMidiDriver::Open(bool capturing, bool playing, int in_channels,
try {
output_ports[num_outputs] = new JackALSARawMidiOutputPort(info, i);
num_outputs++;
} catch (std::exception e) {
} catch (std::exception& e) {
jack_error("JackALSARawMidiDriver::Open - while creating new "
"JackALSARawMidiOutputPort: %s", e.what());
}
@@ -504,7 +504,7 @@ JackALSARawMidiDriver::Start()
}
try {
poll_fds = new pollfd[poll_fd_count];
} catch (std::exception e) {
} catch (std::exception& e) {
jack_error("JackALSARawMidiDriver::Start - creating poll descriptor "
"structures failed: %s", e.what());
return -1;
@@ -512,7 +512,7 @@ JackALSARawMidiDriver::Start()
if (fPlaybackChannels) {
try {
output_port_timeouts = new jack_nframes_t[fPlaybackChannels];
} catch (std::exception e) {
} catch (std::exception& e) {
jack_error("JackALSARawMidiDriver::Start - creating array for "
"output port timeout values failed: %s", e.what());
goto free_poll_descriptors;
@@ -521,7 +521,7 @@ JackALSARawMidiDriver::Start()
struct pollfd *poll_fd_iter;
try {
CreateNonBlockingPipe(fds);
} catch (std::exception e) {
} catch (std::exception& e) {
jack_error("JackALSARawMidiDriver::Start - while creating wake pipe: "
"%s", e.what());
goto free_output_port_timeouts;


+ 1
- 1
linux/firewire/ffado_driver.h View File

@@ -86,7 +86,7 @@
#define debugError(format, args...) jack_error( "firewire ERR: %s:%d (%s): " format, __FILE__, __LINE__, __FUNCTION__, ##args )
#define debugPrint(Level, format, args...) if(DEBUG_LEVEL & (Level)) jack_error("DEBUG %s:%d (%s) :" format, __FILE__, __LINE__, __FUNCTION__, ##args );
#define debugPrintShort(Level, format, args...) if(DEBUG_LEVEL & (Level)) jack_error( format,##args );
#define debugPrintWithTimeStamp(Level, format, args...) if(DEBUG_LEVEL & (Level)) jack_error( "%16lu: "format, debugGetCurrentUTime(),##args );
#define debugPrintWithTimeStamp(Level, format, args...) if(DEBUG_LEVEL & (Level)) jack_error( "%16lu: " format, debugGetCurrentUTime(), ##args );
#define SEGFAULT int *test=NULL; *test=1;
#else
#define DEBUG_LEVEL


+ 1
- 1
posix/JackSocketClientChannel.cpp View File

@@ -39,7 +39,7 @@ JackSocketClientChannel::~JackSocketClientChannel()
delete fNotificationSocket;
}

int JackSocketClientChannel::Open(const char* server_name, const char* name, int uuid, char* name_res, JackClient* client, jack_options_t options, jack_status_t* status)
int JackSocketClientChannel::Open(const char* server_name, const char* name, jack_uuid_t uuid, char* name_res, JackClient* client, jack_options_t options, jack_status_t* status)
{
int result = 0;
jack_log("JackSocketClientChannel::Open name = %s", name);


+ 1
- 1
posix/JackSocketClientChannel.h View File

@@ -49,7 +49,7 @@ class JackSocketClientChannel : public JackGenericClientChannel, public JackRunn
JackSocketClientChannel();
virtual ~JackSocketClientChannel();

int Open(const char* server_name, const char* name, int uuid, char* name_res, JackClient* client, jack_options_t options, jack_status_t* status);
int Open(const char* server_name, const char* name, jack_uuid_t uuid, char* name_res, JackClient* client, jack_options_t options, jack_status_t* status);
void Close();

int Start();


+ 1
- 1
windows/JackWinNamedPipeClientChannel.cpp View File

@@ -38,7 +38,7 @@ JackWinNamedPipeClientChannel::~JackWinNamedPipeClientChannel()
delete fRequest;
}

int JackWinNamedPipeClientChannel::Open(const char* server_name, const char* name, int uuid, char* name_res, JackClient* client, jack_options_t options, jack_status_t* status)
int JackWinNamedPipeClientChannel::Open(const char* server_name, const char* name, jack_uuid_t uuid, char* name_res, JackClient* client, jack_options_t options, jack_status_t* status)
{
int result = 0;
jack_log("JackWinNamedPipeClientChannel::Open name = %s", name);


+ 1
- 1
windows/JackWinNamedPipeClientChannel.h View File

@@ -49,7 +49,7 @@ class JackWinNamedPipeClientChannel : public JackGenericClientChannel, public Ja
JackWinNamedPipeClientChannel();
virtual ~JackWinNamedPipeClientChannel();

int Open(const char* server_name, const char* name, int uuid, char* name_res, JackClient* client, jack_options_t options, jack_status_t* status);
int Open(const char* server_name, const char* name, jack_uuid_t uuid, char* name_res, JackClient* client, jack_options_t options, jack_status_t* status);
void Close();

int Start();


Loading…
Cancel
Save