From 518365e350ffcd20b67c1db3aecc15b731d4c914 Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Mon, 4 Jan 2021 17:25:28 +0100 Subject: [PATCH] pulse-server: fix module arg parsing Parse the module arguments according to the pulseaudio syntax, not our own syntax (which requires "" around a , delimter). Fixes audio.position=FL,FR argument. See #527 --- src/modules/module-protocol-pulse/module.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/modules/module-protocol-pulse/module.c b/src/modules/module-protocol-pulse/module.c index 939d777aa..9d2ccac5c 100644 --- a/src/modules/module-protocol-pulse/module.c +++ b/src/modules/module-protocol-pulse/module.c @@ -133,6 +133,8 @@ static void add_props(struct pw_properties *props, const char *str) f = ' '; } e = strchr(p, f); + if (e == NULL) + e = strchr(p, '\0'); if (e == NULL) break; *e = '\0'; @@ -156,11 +158,13 @@ static int load_module(struct client *client, const char *name, const char *argu res = -EINVAL; goto out; } - props = pw_properties_new_string(argument); + props = pw_properties_new(NULL, NULL); if (props == NULL) { res = -EINVAL; goto out; } + add_props(props, argument); + if ((str = pw_properties_get(props, "sink_name")) != NULL) { pw_properties_set(props, PW_KEY_NODE_NAME, str); pw_properties_set(props, "sink_name", NULL);