X-Git-Url: https://gerrit.automotivelinux.org/gerrit/gitweb?a=blobdiff_plain;f=discover.c;fp=discover.c;h=93a5d8b8965a5683cba5f80ce5e7432af48c4195;hb=6fc3e02df9de8347eb76fdfd26ed781686d37b6c;hp=eea6986de2a4eeef079d6f04340610ebc752cf66;hpb=d126c05ba201b0fd6daabf7c03d05da3db1b2957;p=staging%2Fagl-audio-plugin.git diff --git a/discover.c b/discover.c index eea6986..93a5d8b 100644 --- a/discover.c +++ b/discover.c @@ -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); }