mirror of
https://gitlab.freedesktop.org/pipewire/wireplumber.git
synced 2026-05-07 12:18:04 +02:00
m-si-audio-adapter: ensure ports are available before enabling active
This commit is contained in:
parent
06c12fe7c2
commit
c0143b5f18
1 changed files with 21 additions and 2 deletions
|
|
@ -219,11 +219,31 @@ si_audio_adapter_disable_exported (WpSessionItem *si)
|
||||||
WP_SESSION_ITEM_FEATURE_EXPORTED);
|
WP_SESSION_ITEM_FEATURE_EXPORTED);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
on_sync_done (WpCore * core, GAsyncResult * res, WpTransition * transition)
|
||||||
|
{
|
||||||
|
WpSiAudioAdapter *self = wp_transition_get_source_object (transition);
|
||||||
|
g_autoptr (GError) error = NULL;
|
||||||
|
|
||||||
|
if (!wp_core_sync_finish (core, res, &error)) {
|
||||||
|
wp_transition_return_error (transition, g_steal_pointer (&error));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* make sure ports are available */
|
||||||
|
if (wp_node_get_n_ports (self->node) > 0)
|
||||||
|
wp_object_update_features (WP_OBJECT (self),
|
||||||
|
WP_SESSION_ITEM_FEATURE_ACTIVE, 0);
|
||||||
|
else
|
||||||
|
wp_core_sync (core, NULL, (GAsyncReadyCallback) on_sync_done, transition);
|
||||||
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
on_feature_ports_ready (WpObject * node, GAsyncResult * res,
|
on_feature_ports_ready (WpObject * node, GAsyncResult * res,
|
||||||
WpTransition * transition)
|
WpTransition * transition)
|
||||||
{
|
{
|
||||||
WpSiAudioAdapter *self = wp_transition_get_source_object (transition);
|
WpSiAudioAdapter *self = wp_transition_get_source_object (transition);
|
||||||
|
g_autoptr (WpCore) core = wp_object_get_core (WP_OBJECT (self));
|
||||||
g_autoptr (GError) error = NULL;
|
g_autoptr (GError) error = NULL;
|
||||||
|
|
||||||
if (!wp_object_activate_finish (node, res, &error)) {
|
if (!wp_object_activate_finish (node, res, &error)) {
|
||||||
|
|
@ -231,8 +251,7 @@ on_feature_ports_ready (WpObject * node, GAsyncResult * res,
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
wp_object_update_features (WP_OBJECT (self),
|
wp_core_sync (core, NULL, (GAsyncReadyCallback) on_sync_done, transition);
|
||||||
WP_SESSION_ITEM_FEATURE_ACTIVE, 0);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue