diff --git a/daemon/graph.c b/daemon/graph.c index 0359e571..e2129070 100644 --- a/daemon/graph.c +++ b/daemon/graph.c @@ -1650,7 +1650,12 @@ ladish_client_handle ladish_graph_find_client_by_app(ladish_graph_handle graph_h return NULL; } -ladish_port_handle ladish_graph_find_port_by_name(ladish_graph_handle graph_handle, ladish_client_handle client_handle, const char * name) +ladish_port_handle +ladish_graph_find_port_by_name( + ladish_graph_handle graph_handle, + ladish_client_handle client_handle, + const char * name, + void * vgraph_filter) { struct ladish_graph_client * client_ptr; struct list_head * node_ptr; @@ -1662,6 +1667,12 @@ ladish_port_handle ladish_graph_find_port_by_name(ladish_graph_handle graph_hand list_for_each(node_ptr, &client_ptr->ports) { port_ptr = list_entry(node_ptr, struct ladish_graph_port, siblings_client); + + if (vgraph_filter != NULL && ladish_port_get_vgraph(port_ptr->port) != vgraph_filter) + { + continue; + } + if (strcmp(port_ptr->name, name) == 0) { return port_ptr->port; diff --git a/daemon/graph.h b/daemon/graph.h index 981c88c9..09ad2c55 100644 --- a/daemon/graph.h +++ b/daemon/graph.h @@ -141,7 +141,7 @@ ladish_client_handle ladish_graph_find_client_by_jack_id(ladish_graph_handle gra ladish_port_handle ladish_graph_find_port_by_jack_id(ladish_graph_handle graph_handle, uint64_t port_id, bool room, bool studio); ladish_client_handle ladish_graph_find_client_by_name(ladish_graph_handle graph_handle, const char * name, bool appless); ladish_client_handle ladish_graph_find_client_by_app(ladish_graph_handle graph_handle, const uuid_t app_uuid); -ladish_port_handle ladish_graph_find_port_by_name(ladish_graph_handle graph_handle, ladish_client_handle client_handle, const char * name); +ladish_port_handle ladish_graph_find_port_by_name(ladish_graph_handle graph_handle, ladish_client_handle client_handle, const char * name, void * vgraph_filter); ladish_client_handle ladish_graph_find_client_by_uuid(ladish_graph_handle graph_handle, const uuid_t uuid); ladish_port_handle ladish_graph_find_port_by_uuid(ladish_graph_handle graph_handle, const uuid_t uuid, bool use_link_override_uuids, void * vgraph_filter); diff --git a/daemon/virtualizer.c b/daemon/virtualizer.c index 5ee74860..36c34057 100644 --- a/daemon/virtualizer.c +++ b/daemon/virtualizer.c @@ -592,7 +592,7 @@ port_appeared( * if not found - create new port and add it to the jack graph. * Then process to adding it to virtual graph */ - port = ladish_graph_find_port_by_name(virtualizer_ptr->jack_graph, jack_client, jack_port_name); + port = ladish_graph_find_port_by_name(virtualizer_ptr->jack_graph, jack_client, jack_port_name, vgraph); if (port != NULL) { log_info("found existing port %p", port);