mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-05 13:30:02 -05:00
media-session: improve category
This commit is contained in:
parent
ecc287edcf
commit
73602ad98a
1 changed files with 8 additions and 2 deletions
|
|
@ -457,8 +457,14 @@ static int handle_autoconnect(struct impl *impl, struct pw_node *node,
|
|||
if ((media = pw_properties_get(props, PW_NODE_PROP_MEDIA)) == NULL)
|
||||
media = "Audio";
|
||||
|
||||
if ((category = pw_properties_get(props, PW_NODE_PROP_CATEGORY)) == NULL)
|
||||
if ((category = pw_properties_get(props, PW_NODE_PROP_CATEGORY)) == NULL) {
|
||||
if (node->info.n_input_ports > 0 && node->info.n_output_ports == 0)
|
||||
category = "Capture";
|
||||
else if (node->info.n_output_ports > 0 && node->info.n_input_ports == 0)
|
||||
category = "Playback";
|
||||
else
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
if ((role = pw_properties_get(props, PW_NODE_PROP_ROLE)) == NULL)
|
||||
role = "Music";
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue