summaryrefslogtreecommitdiff
path: root/pipewire-jack
diff options
context:
space:
mode:
authorWim Taymans <wtaymans@redhat.com>2020-08-11 12:12:37 +0200
committerWim Taymans <wtaymans@redhat.com>2020-08-11 12:12:37 +0200
commitcc044b0e08028e83a694a6de280b616ffc48b2ef (patch)
tree6e8450c5b1143552237613f2cbd7fa27889df7e0 /pipewire-jack
parentf73a0c97e31fbf3c0c45e2be07535003f9db6a83 (diff)
jack: don't overwrite any PIPEWIRE_PROPS values
Diffstat (limited to 'pipewire-jack')
-rw-r--r--pipewire-jack/src/pipewire-jack.c27
1 files changed, 16 insertions, 11 deletions
diff --git a/pipewire-jack/src/pipewire-jack.c b/pipewire-jack/src/pipewire-jack.c
index c5b2b249..1b807951 100644
--- a/pipewire-jack/src/pipewire-jack.c
+++ b/pipewire-jack/src/pipewire-jack.c
@@ -2338,7 +2338,7 @@ jack_client_t * jack_client_open (const char *client_name,
{
struct client *client;
struct spa_dict props;
- struct spa_dict_item items[6];
+ struct spa_dict_item items[1];
const struct spa_support *support;
uint32_t n_support;
const char *str;
@@ -2441,16 +2441,21 @@ jack_client_t * jack_client_open (const char *client_name,
if (client->props == NULL)
goto init_failed;
- props = SPA_DICT_INIT(items, 0);
- items[props.n_items++] = SPA_DICT_ITEM_INIT(PW_KEY_NODE_NAME, client_name);
- items[props.n_items++] = SPA_DICT_ITEM_INIT(PW_KEY_MEDIA_TYPE, "Audio");
- items[props.n_items++] = SPA_DICT_ITEM_INIT(PW_KEY_MEDIA_CATEGORY, "Duplex");
- items[props.n_items++] = SPA_DICT_ITEM_INIT(PW_KEY_MEDIA_ROLE, "DSP");
- if ((str = getenv("PIPEWIRE_LATENCY")) != NULL)
- items[props.n_items++] = SPA_DICT_ITEM_INIT(PW_KEY_NODE_LATENCY, str);
- items[props.n_items++] = SPA_DICT_ITEM_INIT(PW_KEY_NODE_ALWAYS_PROCESS, "true");
-
- pw_properties_add(client->props, &props);
+ if (pw_properties_get(client->props, PW_KEY_NODE_NAME) == NULL)
+ pw_properties_set(client->props, PW_KEY_NODE_NAME, client_name);
+ if (pw_properties_get(client->props, PW_KEY_NODE_DESCRIPTION) == NULL)
+ pw_properties_set(client->props, PW_KEY_NODE_DESCRIPTION, client_name);
+ if (pw_properties_get(client->props, PW_KEY_MEDIA_TYPE) == NULL)
+ pw_properties_set(client->props, PW_KEY_MEDIA_TYPE, "Audio");
+ if (pw_properties_get(client->props, PW_KEY_MEDIA_CATEGORY) == NULL)
+ pw_properties_set(client->props, PW_KEY_MEDIA_CATEGORY, "Duplex");
+ if (pw_properties_get(client->props, PW_KEY_MEDIA_ROLE) == NULL)
+ pw_properties_set(client->props, PW_KEY_MEDIA_ROLE, "DSP");
+ if (pw_properties_get(client->props, PW_KEY_NODE_LATENCY) == NULL &&
+ (str = getenv("PIPEWIRE_LATENCY")) != NULL)
+ pw_properties_set(client->props, PW_KEY_NODE_LATENCY, str);
+ if (pw_properties_get(client->props, PW_KEY_NODE_ALWAYS_PROCESS) == NULL)
+ pw_properties_set(client->props, PW_KEY_NODE_ALWAYS_PROCESS, "true");
client->node = pw_core_create_object(client->core,
"client-node",