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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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



[Index of Archives]     [Linux Audio Users]     [AMD Graphics]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux