[pulseaudio-discuss] [PATCH 10/15] node: Delete edges when deactivating a node

Tanu Kaskinen tanu.kaskinen at linux.intel.com
Thu Feb 13 19:35:55 CET 2014


When changing a sink port, for example, streams shouldn't be connected
to the deactivated port node any more.
---
 src/pulsecore/node.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/src/pulsecore/node.c b/src/pulsecore/node.c
index 2475c85..41e95ee 100644
--- a/src/pulsecore/node.c
+++ b/src/pulsecore/node.c
@@ -459,6 +459,15 @@ void pa_node_active_changed(pa_node *node, bool new_active) {
     if (new_active == node->active)
         return;
 
+    if (!new_active) {
+        pa_edge *edge;
+
+        while ((edge = pa_hashmap_steal_first(node->edges))) {
+            pa_log_debug("Deleting edge %s due to deactivation of one of its endpoints.", edge->string);
+            pa_core_delete_edge(node->core, edge);
+        }
+    }
+
     node->active = new_active;
 
     pa_log_debug("Node %s %s.", node->name, new_active ? "activated" : "deactivated");
-- 
1.8.3.1



More information about the pulseaudio-discuss mailing list