ladishd: properly handle a2j ports for apps with same names

For real jack ports it works because different apps have different jack client.
For a2j ports, it did not work because the jack client is same and the
a2j_fake_jack_port_name is same too, because the instead of alsa client name,
the app name is used now
This commit is contained in:
Nedko Arnaudov 2010-11-08 02:39:53 +02:00
parent ee830a52ee
commit a608c373e6
3 changed files with 14 additions and 3 deletions

View File

@ -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;

View File

@ -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);

View File

@ -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);