[pulseaudio-discuss] [PATCH 14/15] edge: Refuse to connect inactive nodes
Tanu Kaskinen
tanu.kaskinen at linux.intel.com
Thu Feb 13 19:35:59 CET 2014
---
src/pulsecore/edge.c | 6 ++++++
src/pulsecore/node.c | 8 --------
2 files changed, 6 insertions(+), 8 deletions(-)
diff --git a/src/pulsecore/edge.c b/src/pulsecore/edge.c
index 177ae3f..cc8807a 100644
--- a/src/pulsecore/edge.c
+++ b/src/pulsecore/edge.c
@@ -297,6 +297,12 @@ static int edge_put(pa_edge *edge) {
pa_assert(edge);
+ if (!edge->input->active || !edge->output->active) {
+ pa_log_info("Can't create edge %s, both nodes are not active.", edge->string);
+ r = -PA_ERR_NOTSUPPORTED;
+ goto fail;
+ }
+
pa_node_add_edge(edge->input, edge);
pa_node_add_edge(edge->output, edge);
diff --git a/src/pulsecore/node.c b/src/pulsecore/node.c
index 530c9b2..50e95d1 100644
--- a/src/pulsecore/node.c
+++ b/src/pulsecore/node.c
@@ -248,14 +248,6 @@ static void set_initial_routing_fallback(pa_node_set_initial_routing_hook_data *
output = routee;
}
- if (!routing_target->active) {
- /* Let's keep the fallback policy simple, and not try to activate any
- * inactive nodes. */
- pa_log_info("Can't connect %s to %s, %s is not active.", input->name, output->name, routing_target->name);
- data->ret = -PA_ERR_INVALID;
- return;
- }
-
data->ret = pa_core_create_edge(routee->core, input, output, NULL);
return;
--
1.8.3.1
More information about the pulseaudio-discuss
mailing list