mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-11 13:30:07 -05:00
media-session: sanitize name and nick
Replace unwanted chars in the name with _. This makes it compatible with pulseaudio names and avoids problems with regex. Replace unwanred chars in the nick with ' '. This ensures JACK clients don't receive ':' in the device names, which cause it to fail when parsing the ports. See #714 and #130
This commit is contained in:
parent
ac910c7c1c
commit
062911640c
5 changed files with 55 additions and 10 deletions
|
|
@ -133,6 +133,7 @@ static struct node *bluez5_create_node(struct device *device, uint32_t id,
|
|||
int res;
|
||||
const char *prefix, *str, *profile, *rules;
|
||||
int priority;
|
||||
char name[1024];
|
||||
|
||||
pw_log_debug("new node %u", id);
|
||||
|
||||
|
|
@ -175,7 +176,10 @@ static struct node *bluez5_create_node(struct device *device, uint32_t id,
|
|||
else
|
||||
prefix = info->factory_name;
|
||||
|
||||
pw_properties_setf(node->props, PW_KEY_NODE_NAME, "%s.%s.%s", prefix, str, profile);
|
||||
pw_properties_set(node->props, PW_KEY_NODE_NAME,
|
||||
sm_media_session_sanitize_name(name, sizeof(name),
|
||||
'_', "%s.%s.%s", prefix, str, profile));
|
||||
|
||||
pw_properties_set(node->props, PW_KEY_FACTORY_NAME, info->factory_name);
|
||||
|
||||
if (pw_properties_get(node->props, PW_KEY_PRIORITY_DRIVER) == NULL) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue