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
This commit is contained in:
George Kiagiadakis 2020-06-17 14:47:54 +03:00
parent aabf6beda7
commit a1a718f8a1

View file

@ -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);