diff options
author | Wim Taymans <wtaymans@redhat.com> | 2020-08-03 16:28:09 +0200 |
---|---|---|
committer | Wim Taymans <wtaymans@redhat.com> | 2020-08-03 16:28:09 +0200 |
commit | 79937676a4fc1556e6ba2bc981ea996bca2e041d (patch) | |
tree | db931c0152759ab46441854e6752ff0c1513a1be | |
parent | a655e8f6df49ea7ec5231b9606357f3f44ef2b55 (diff) |
alsa: add profile description in node description
-rw-r--r-- | src/examples/media-session/alsa-monitor.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/examples/media-session/alsa-monitor.c b/src/examples/media-session/alsa-monitor.c index 1dce4d65..a9a85108 100644 --- a/src/examples/media-session/alsa-monitor.c +++ b/src/examples/media-session/alsa-monitor.c @@ -192,7 +192,7 @@ static struct node *alsa_create_node(struct device *device, uint32_t id, struct node *node; struct impl *impl = device->impl; int res; - const char *dev, *subdev, *stream, *profile; + const char *dev, *subdev, *stream, *profile, *profile_desc; int priority; pw_log_debug("new node %u", id); @@ -223,6 +223,7 @@ static struct node *alsa_create_node(struct device *device, uint32_t id, stream = "unknown"; if ((profile = pw_properties_get(node->props, "device.profile.name")) == NULL) profile = "unknown"; + profile_desc = pw_properties_get(node->props, "device.profile.description"); if (!strcmp(stream, "capture")) node->direction = PW_DIRECTION_OUTPUT; @@ -276,7 +277,10 @@ static struct node *alsa_create_node(struct device *device, uint32_t id, if (name == NULL) name = dev; - if (strcmp(subdev, "0")) { + if (profile_desc != NULL) { + pw_properties_setf(node->props, PW_KEY_NODE_DESCRIPTION, "%s %s", + desc, profile_desc); + } else if (strcmp(subdev, "0")) { pw_properties_setf(node->props, PW_KEY_NODE_DESCRIPTION, "%s (%s %s)", desc, name, subdev); } else if (strcmp(dev, "0")) { |