Browse Source

miscellaneous fixes to prepare the way for usable metadata

* move port UUID initialization into engine so that it is actually shared across clients
* export jack_server_dir() within libjack
tags/0.124.0
Paul Davis 12 years ago
parent
commit
5d360dd61e
4 changed files with 13 additions and 6 deletions
  1. +5
    -3
      jackd/engine.c
  2. +7
    -2
      libjack/client.c
  3. +1
    -0
      libjack/local.h
  4. +0
    -1
      libjack/port.c

+ 5
- 3
jackd/engine.c View File

@@ -4349,6 +4349,7 @@ fallback:
next:
shared->ptype_id = engine->control->port_types[i].ptype_id;
jack_uuid_copy (shared->client_id, req->x.port_info.client_id);
uuid_generate (shared->uuid);
shared->flags = req->x.port_info.flags;
shared->latency = 0;
shared->capture_latency.min = shared->capture_latency.max = 0;
@@ -4399,9 +4400,10 @@ jack_port_do_unregister (jack_engine_t *engine, jack_request_t *req)
shared = &engine->control->ports[req->x.port_info.port_id];

if (shared->client_id != req->x.port_info.client_id) {
jack_error ("Client %" PRIu32
" is not allowed to remove port %s",
req->x.port_info.client_id, shared->name);
char buf[JACK_UUID_STRING_SIZE];
jack_uuid_unparse (req->x.port_info.client_id, buf);
jack_error ("Client %s is not allowed to remove port %s",
buf, shared->name);
return -1;
}



+ 7
- 2
libjack/client.c View File

@@ -1412,8 +1412,13 @@ jack_server_dir (const char *server_name, char *server_dir)
/* format the path name into the suppled server_dir char array,
* assuming that server_dir is at least as large as PATH_MAX+1 */

snprintf (server_dir, PATH_MAX+1, "%s/%s",
jack_user_dir (), server_name);
if (server_name == NULL || server_name[0] == '\0') {
snprintf (server_dir, PATH_MAX+1, "%s/%s",
jack_user_dir (), jack_default_server_name());
} else {
snprintf (server_dir, PATH_MAX+1, "%s/%s",
jack_user_dir (), server_name);
}

return server_dir;
}


+ 1
- 0
libjack/local.h View File

@@ -94,5 +94,6 @@ extern jack_port_t *jack_port_new (const jack_client_t *client,
extern void *jack_zero_filled_buffer;

extern void jack_set_clock_source (jack_timer_type_t);
extern char* jack_server_dir (const char* server_name, char* server_dir);

#endif /* __jack_libjack_local_h__ */

+ 0
- 1
libjack/port.c View File

@@ -194,7 +194,6 @@ jack_port_new (const jack_client_t *client, jack_port_id_t port_id,
pthread_mutex_init (&port->connection_lock, NULL);
port->connections = 0;
port->tied = NULL;
uuid_generate (port->shared->uuid);

if (jack_uuid_compare (client->control->uuid, port->shared->client_id) == 0) {


Loading…
Cancel
Save