mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-10-31 22:25:38 -04:00
jack: handle bridge nodes
Bridges have the device name in the port names so use this info to construct better port names. Makes midi devices show up as separate clients.
This commit is contained in:
parent
062911640c
commit
0945b10227
1 changed files with 9 additions and 1 deletions
|
|
@ -111,6 +111,7 @@ struct object {
|
|||
char name[JACK_CLIENT_NAME_SIZE+1];
|
||||
int32_t priority;
|
||||
uint32_t client_id;
|
||||
bool is_bridge;
|
||||
} node;
|
||||
struct {
|
||||
uint32_t src;
|
||||
|
|
@ -2102,6 +2103,9 @@ static void registry_event_global(void *data, uint32_t id,
|
|||
|
||||
app = spa_dict_lookup(props, PW_KEY_APP_NAME);
|
||||
|
||||
if ((str = spa_dict_lookup(props, PW_KEY_MEDIA_CLASS)) != NULL)
|
||||
o->node.is_bridge = strstr(str, "Bridge") != NULL;
|
||||
|
||||
if ((str = spa_dict_lookup(props, PW_KEY_NODE_NICK)) == NULL &&
|
||||
(str = spa_dict_lookup(props, PW_KEY_NODE_DESCRIPTION)) == NULL &&
|
||||
(str = node_name) == NULL) {
|
||||
|
|
@ -2195,7 +2199,11 @@ static void registry_event_global(void *data, uint32_t id,
|
|||
if (ot == NULL || ot->type != INTERFACE_Node)
|
||||
goto exit_free;
|
||||
|
||||
snprintf(o->port.name, sizeof(o->port.name), "%s:%s", ot->node.name, str);
|
||||
if (ot->node.is_bridge && strchr(str, ':') != NULL)
|
||||
snprintf(o->port.name, sizeof(o->port.name), "%s", str);
|
||||
else
|
||||
snprintf(o->port.name, sizeof(o->port.name), "%s:%s", ot->node.name, str);
|
||||
|
||||
o->port.port_id = SPA_ID_INVALID;
|
||||
o->port.priority = ot->node.priority;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue