From a1a718f8a1d07e3824303c638355694c9cf8dd73 Mon Sep 17 00:00:00 2001 From: George Kiagiadakis Date: Wed, 17 Jun 2020 14:47:54 +0300 Subject: [PATCH] config-endpoint: create monitors after exporting This fixes a failure to activate the monitors if we are using si-adapter directly instead of si-audio-softdsp-endpoint --- modules/module-config-endpoint/context.c | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/modules/module-config-endpoint/context.c b/modules/module-config-endpoint/context.c index f2c3209c..2d5549ff 100644 --- a/modules/module-config-endpoint/context.c +++ b/modules/module-config-endpoint/context.c @@ -53,10 +53,14 @@ get_streams_data (WpConfiguration *config, const char *file_name) return wp_config_parser_get_matched_data (parser, (gpointer)file_name); } +static void endpoint_activate_finish_cb (WpSessionItem * ep, GAsyncResult * res, + WpConfigEndpointContext * self); + static void endpoint_export_finish_cb (WpSessionItem * ep, GAsyncResult * res, WpConfigEndpointContext * self) { + WpSessionItem * monitor = NULL; g_autoptr (GError) error = NULL; gboolean export_ret = wp_session_item_export_finish (ep, res, &error); if (!export_ret) { @@ -64,6 +68,12 @@ endpoint_export_finish_cb (WpSessionItem * ep, GAsyncResult * res, return; } + /* Activate monitor if any */ + monitor = g_object_get_qdata (G_OBJECT (ep), monitor_quark ()); + if (monitor) + wp_session_item_activate (monitor, + (GAsyncReadyCallback) endpoint_activate_finish_cb, self); + /* Emit the signal */ g_signal_emit (self, signals[SIGNAL_ENDPOINT_CREATED], 0, ep); } @@ -72,7 +82,6 @@ static void endpoint_activate_finish_cb (WpSessionItem * ep, GAsyncResult * res, WpConfigEndpointContext * self) { - WpSessionItem * monitor = NULL; WpSession * session = NULL; g_autoptr (GError) error = NULL; gboolean activate_ret = wp_session_item_activate_finish (ep, res, &error); @@ -81,12 +90,6 @@ endpoint_activate_finish_cb (WpSessionItem * ep, GAsyncResult * res, return; } - /* Activate monitor if any */ - monitor = g_object_get_qdata (G_OBJECT (ep), monitor_quark ()); - if (monitor) - wp_session_item_activate (monitor, - (GAsyncReadyCallback) endpoint_activate_finish_cb, self); - /* Get the session */ session = g_object_get_qdata (G_OBJECT (ep), session_quark ()); g_return_if_fail (session);