diff options
author | Manuel Bachmann <manuel.bachmann@iot.bzh> | 2016-06-13 10:11:28 +0200 |
---|---|---|
committer | Yannick Gicquel <yannick.gicquel@iot.bzh> | 2016-10-11 17:09:07 +0200 |
commit | 6fc3e02df9de8347eb76fdfd26ed781686d37b6c (patch) | |
tree | a291b1fa88b957941e9abd3baee01df26ebf4177 /discover.c | |
parent | d126c05ba201b0fd6daabf7c03d05da3db1b2957 (diff) |
Clean up node status after sink_input unlink
We now unload all modules associated with a node when
it disappears.
Change-Id: I6d2055d546c9cc1b1967f85c973eafcc216bc91f
Signed-off-by: Manuel Bachmann <manuel.bachmann@iot.bzh>
Diffstat (limited to 'discover.c')
-rw-r--r-- | discover.c | 24 |
1 files changed, 22 insertions, 2 deletions
@@ -757,6 +757,26 @@ void pa_discover_add_sink_input (struct userdata *u, pa_sink_input *sinp) node = agl_node_get_from_client (u, sinp->client); if (!node) return; - /* start the default routing */ - implement_default_route (u, node, NULL, pa_utils_new_stamp ()); + /* start routing */ + agl_router_register_node (u, node); +} + +void pa_discover_remove_sink_input (struct userdata *u, pa_sink_input *sinp) +{ + pa_core *core; + agl_node *node; + + pa_assert (u); + pa_assert (sinp); + pa_assert_se (core = u->core); + + if (!sinp->client) + return; + + /* is there an existing matching node ? */ + node = agl_node_get_from_client (u, sinp->client); + if (!node) return; + + /* stop routing */ + agl_router_unregister_node (u, node); } |