[PATCH 22/23] node: Notify pa_router about new and removed nodes

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

 



---
 src/pulsecore/node.c | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/src/pulsecore/node.c b/src/pulsecore/node.c
index 7b4d61f..02b3f84 100644
--- a/src/pulsecore/node.c
+++ b/src/pulsecore/node.c
@@ -26,6 +26,7 @@
 
 #include <pulsecore/core-util.h>
 #include <pulsecore/namereg.h>
+#include <pulsecore/router.h>
 #include <pulsecore/strbuf.h>
 
 #include "node.h"
@@ -157,9 +158,11 @@ void pa_node_put(pa_node *node) {
     pa_assert(node->owner);
 
     pa_assert_se(pa_idxset_put(node->core->nodes, node, &node->index) >= 0);
-
     node->state = PA_NODE_STATE_LINKED;
 
+    if (node->core->router)
+        pa_router_add_node(node->core->router, node);
+
     pa_log_debug("Created node %s.", node->name);
 }
 
@@ -171,8 +174,10 @@ void pa_node_unlink(pa_node *node) {
         return;
 
     pa_log_debug("Unlinking node %s.", node->name);
+    node->state = PA_NODE_STATE_UNLINKED;
 
-    pa_assert_se(pa_idxset_remove_by_index(node->core->nodes, node->index));
+    if (node->core->router)
+        pa_router_remove_node(node->core->router, node);
 
-    node->state = PA_NODE_STATE_UNLINKED;
+    pa_assert_se(pa_idxset_remove_by_index(node->core->nodes, node->index));
 }
-- 
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