ladishd: properly detect connect failures

This fixes a bug when port is appearing, connect attempt is made,
connect fails because port has just disappeared, port reappears then
but new connect attempt was not made. Happens quite easily with
wineasio apps that "probe" (nuendo2 for example).
This commit is contained in:
Nedko Arnaudov 2010-11-01 21:28:28 +02:00
parent 9592afef25
commit 1b66932459
3 changed files with 12 additions and 10 deletions

View File

@ -887,9 +887,7 @@ static bool ports_connect_request(void * context, ladish_graph_handle graph_hand
port2_id = ladish_port_get_jack_id_room(port2);
}
graph_proxy_connect_ports(virtualizer_ptr->jack_graph_proxy, port1_id, port2_id);
return true;
return graph_proxy_connect_ports(virtualizer_ptr->jack_graph_proxy, port1_id, port2_id);
}
static bool ports_disconnect_request(void * context, ladish_graph_handle graph_handle, uint64_t connection_id)
@ -920,9 +918,7 @@ static bool ports_disconnect_request(void * context, ladish_graph_handle graph_h
port2_id = ladish_port_get_jack_id_room(port2);
}
graph_proxy_disconnect_ports(virtualizer_ptr->jack_graph_proxy, port1_id, port2_id);
return true;
return graph_proxy_disconnect_ports(virtualizer_ptr->jack_graph_proxy, port1_id, port2_id);
}
static void ports_connected(void * context, uint64_t client1_id, uint64_t port1_id, uint64_t client2_id, uint64_t port2_id)

View File

@ -565,7 +565,7 @@ graph_proxy_detach(
ASSERT(false);
}
void
bool
graph_proxy_connect_ports(
graph_proxy_handle graph,
uint64_t port1_id,
@ -574,10 +574,13 @@ graph_proxy_connect_ports(
if (!dbus_call(graph_ptr->service, graph_ptr->object, JACKDBUS_IFACE_PATCHBAY, "ConnectPortsByID", "tt", &port1_id, &port2_id, ""))
{
log_error("ConnectPortsByID() failed.");
return false;
}
return true;
}
void
bool
graph_proxy_disconnect_ports(
graph_proxy_handle graph,
uint64_t port1_id,
@ -586,7 +589,10 @@ graph_proxy_disconnect_ports(
if (!dbus_call(graph_ptr->service, graph_ptr->object, JACKDBUS_IFACE_PATCHBAY, "DisconnectPortsByID", "tt", &port1_id, &port2_id, ""))
{
log_error("DisconnectPortsByID() failed.");
return false;
}
return true;
}
static void on_client_appeared(void * graph, DBusMessage * message_ptr)

View File

@ -75,13 +75,13 @@ graph_proxy_detach(
graph_proxy_handle graph,
void * context);
void
bool
graph_proxy_connect_ports(
graph_proxy_handle graph,
uint64_t port1_id,
uint64_t port2_id);
void
bool
graph_proxy_disconnect_ports(
graph_proxy_handle graph,
uint64_t port1_id,