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
This commit is contained in:
Wim Taymans 2021-04-08 16:02:28 +02:00
parent 9019edec31
commit 2e18d8d005

View file

@ -244,7 +244,12 @@ static struct module *create_module_loopback(struct impl *impl, const char *argu
*/
if ((str = pw_properties_get(props, "source")) != NULL) {
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);
}