mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-10-31 22:25:38 -04:00
jack: Assign unique name to client_name
First try to make a unique node name and then assign this as the client_name. This ensures we can detect a client name change because of a name conflict and we properly handle the JackNameNotUnique and JackUseExactName client open options. Also emit a new client event when the client name existed but was from another client and we made a unique name. Fixes #2833
This commit is contained in:
parent
249cf9bfbe
commit
5485db09dc
1 changed files with 6 additions and 7 deletions
|
|
@ -2925,7 +2925,7 @@ static void registry_event_global(void *data, uint32_t id,
|
||||||
struct client *c = (struct client *) data;
|
struct client *c = (struct client *) data;
|
||||||
struct object *o, *ot, *op;
|
struct object *o, *ot, *op;
|
||||||
const char *str;
|
const char *str;
|
||||||
bool is_first = false;
|
bool is_first = true;
|
||||||
uint32_t serial;
|
uint32_t serial;
|
||||||
|
|
||||||
if (props == NULL)
|
if (props == NULL)
|
||||||
|
|
@ -2950,12 +2950,6 @@ static void registry_event_global(void *data, uint32_t id,
|
||||||
|
|
||||||
node_name = spa_dict_lookup(props, PW_KEY_NODE_NAME);
|
node_name = spa_dict_lookup(props, PW_KEY_NODE_NAME);
|
||||||
|
|
||||||
if (id == c->node_id) {
|
|
||||||
pw_log_debug("%p: add our node %d", c, id);
|
|
||||||
if (node_name != NULL)
|
|
||||||
snprintf(c->name, sizeof(c->name), "%s", node_name);
|
|
||||||
c->serial = serial;
|
|
||||||
}
|
|
||||||
snprintf(o->node.node_name, sizeof(o->node.node_name),
|
snprintf(o->node.node_name, sizeof(o->node.node_name),
|
||||||
"%s", node_name);
|
"%s", node_name);
|
||||||
|
|
||||||
|
|
@ -2991,6 +2985,11 @@ static void registry_event_global(void *data, uint32_t id,
|
||||||
is_first = ot == NULL;
|
is_first = ot == NULL;
|
||||||
snprintf(o->node.name, sizeof(o->node.name), "%s", tmp);
|
snprintf(o->node.name, sizeof(o->node.name), "%s", tmp);
|
||||||
}
|
}
|
||||||
|
if (id == c->node_id) {
|
||||||
|
pw_log_debug("%p: add our node %d", c, id);
|
||||||
|
snprintf(c->name, sizeof(c->name), "%s", o->node.name);
|
||||||
|
c->serial = serial;
|
||||||
|
}
|
||||||
|
|
||||||
if ((str = spa_dict_lookup(props, PW_KEY_PRIORITY_SESSION)) != NULL)
|
if ((str = spa_dict_lookup(props, PW_KEY_PRIORITY_SESSION)) != NULL)
|
||||||
o->node.priority = pw_properties_parse_int(str);
|
o->node.priority = pw_properties_parse_int(str);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue