From 2e18d8d0054d57fc6eae521f529348e260e3df7f Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Thu, 8 Apr 2021 16:02:28 +0200 Subject: [PATCH] module-loopback: fix connecting to the .monitor source When a pulseaudio clients asks to be connected to a monitor of a sink we need to specify the sink to the session manager as the target. Fixes #1024 --- src/modules/module-protocol-pulse/module-loopback.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/modules/module-protocol-pulse/module-loopback.c b/src/modules/module-protocol-pulse/module-loopback.c index 657770388..c7b1f2315 100644 --- a/src/modules/module-protocol-pulse/module-loopback.c +++ b/src/modules/module-protocol-pulse/module-loopback.c @@ -244,7 +244,12 @@ static struct module *create_module_loopback(struct impl *impl, const char *argu */ if ((str = pw_properties_get(props, "source")) != NULL) { - pw_properties_set(capture_props, PW_KEY_NODE_TARGET, str); + if (pw_endswith(str, ".monitor")) { + pw_properties_setf(capture_props, PW_KEY_NODE_TARGET, + "%.*s", (int)strlen(str)-8, str); + } else { + pw_properties_set(capture_props, PW_KEY_NODE_TARGET, str); + } pw_properties_set(props, "source", NULL); }