From 9e9504c7cd7786da6cf8bad54f4e5f63715bdf50 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=A9mie=20Galarneau?= Date: Thu, 25 Feb 2016 12:30:28 -0500 Subject: [PATCH] Register sink components to the event notification by default MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Jérémie Galarneau --- lib/plugin-system/sink.c | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/lib/plugin-system/sink.c b/lib/plugin-system/sink.c index 4f705a001..c1d1df066 100644 --- a/lib/plugin-system/sink.c +++ b/lib/plugin-system/sink.c @@ -69,13 +69,22 @@ struct bt_component *bt_component_sink_create( goto end; } - ret = bt_component_init(&sink->parent, bt_component_sink_destroy); + sink->parent.class = bt_get(class); + ret = bt_component_init(&sink->parent, NULL); if (ret != BT_COMPONENT_STATUS_OK) { - BT_PUT(sink); - goto end; + goto error; + } + + ret = bt_component_sink_register_notification_type(&sink->parent, + BT_NOTIFICATION_TYPE_EVENT); + if (ret != BT_COMPONENT_STATUS_OK) { + goto error; } end: return sink ? &sink->parent : NULL; +error: + BT_PUT(sink); + return NULL; } enum bt_component_status bt_component_sink_handle_notification( -- 2.34.1