pulse-server: Make node.description

If no node.description is given in the Properties, use the node.name to
make a nicer name.

Fixes #2086
This commit is contained in:
Wim Taymans 2022-02-06 18:56:31 +01:00
parent cec420478a
commit 136989eaa6
2 changed files with 16 additions and 0 deletions

View file

@ -217,6 +217,14 @@ struct module *create_module_ladspa_sink(struct impl *impl, const char *argument
if (pw_properties_get(capture_props, PW_KEY_DEVICE_CLASS) == NULL) if (pw_properties_get(capture_props, PW_KEY_DEVICE_CLASS) == NULL)
pw_properties_set(capture_props, PW_KEY_DEVICE_CLASS, "filter"); pw_properties_set(capture_props, PW_KEY_DEVICE_CLASS, "filter");
if ((str = pw_properties_get(capture_props, PW_KEY_NODE_DESCRIPTION)) == NULL) {
str = pw_properties_get(capture_props, PW_KEY_NODE_NAME);
pw_properties_setf(props, PW_KEY_NODE_DESCRIPTION,
"%s Sink", str);
} else {
pw_properties_set(props, PW_KEY_NODE_DESCRIPTION, str);
}
if ((str = pw_properties_get(props, "master")) != NULL || if ((str = pw_properties_get(props, "master")) != NULL ||
(str = pw_properties_get(props, "sink_master")) != NULL) { (str = pw_properties_get(props, "sink_master")) != NULL) {
pw_properties_set(playback_props, PW_KEY_NODE_TARGET, str); pw_properties_set(playback_props, PW_KEY_NODE_TARGET, str);

View file

@ -217,6 +217,14 @@ struct module *create_module_ladspa_source(struct impl *impl, const char *argume
if (pw_properties_get(playback_props, PW_KEY_DEVICE_CLASS) == NULL) if (pw_properties_get(playback_props, PW_KEY_DEVICE_CLASS) == NULL)
pw_properties_set(playback_props, PW_KEY_DEVICE_CLASS, "filter"); pw_properties_set(playback_props, PW_KEY_DEVICE_CLASS, "filter");
if ((str = pw_properties_get(playback_props, PW_KEY_NODE_DESCRIPTION)) == NULL) {
str = pw_properties_get(playback_props, PW_KEY_NODE_NAME);
pw_properties_setf(props, PW_KEY_NODE_DESCRIPTION,
"%s Source", str);
} else {
pw_properties_set(props, PW_KEY_NODE_DESCRIPTION, str);
}
if ((str = pw_properties_get(props, "master")) != NULL || if ((str = pw_properties_get(props, "master")) != NULL ||
(str = pw_properties_get(props, "source_master")) != NULL) { (str = pw_properties_get(props, "source_master")) != NULL) {
pw_properties_set(capture_props, PW_KEY_NODE_TARGET, str); pw_properties_set(capture_props, PW_KEY_NODE_TARGET, str);