pulse-server: handle .monitor master source

This commit is contained in:
Wim Taymans 2023-01-10 16:22:39 +01:00
parent ff69454eb4
commit 8767e8ed97
2 changed files with 17 additions and 2 deletions

View file

@ -219,7 +219,15 @@ static int module_ladspa_source_prepare(struct module * const module)
if ((str = pw_properties_get(props, "master")) != NULL ||
(str = pw_properties_get(props, "source_master")) != NULL) {
if (spa_strendswith(str, ".monitor")) {
pw_properties_setf(capture_props, PW_KEY_TARGET_OBJECT,
"%.*s", (int)strlen(str)-8, str);
pw_properties_set(capture_props, PW_KEY_STREAM_CAPTURE_SINK,
"true");
} else {
pw_properties_set(capture_props, PW_KEY_TARGET_OBJECT, str);
}
pw_properties_set(props, "source_master", NULL);
pw_properties_set(props, "master", NULL);
}

View file

@ -197,7 +197,14 @@ static int module_remap_source_prepare(struct module * const module)
}
}
if ((str = pw_properties_get(props, "master")) != NULL) {
if (spa_strendswith(str, ".monitor")) {
pw_properties_setf(capture_props, PW_KEY_TARGET_OBJECT,
"%.*s", (int)strlen(str)-8, str);
pw_properties_set(capture_props, PW_KEY_STREAM_CAPTURE_SINK,
"true");
} else {
pw_properties_set(capture_props, PW_KEY_TARGET_OBJECT, str);
}
pw_properties_set(props, "master", NULL);
}