From 4ad92cc00f6beb6e29c36b7c8316df9b7360903d Mon Sep 17 00:00:00 2001 From: George Kiagiadakis Date: Wed, 14 Jul 2021 12:37:45 +0300 Subject: server: sync suspend status after binding metadata If the icipc server got a suspend request before the metadata object was bound, set the metadata after binding. This also helps in case the pw_core was disconnected and reconnected while there was still an icipc client actively suspending playback Signed-off-by: George Kiagiadakis --- src/module-protocol-ic-ipc.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src') diff --git a/src/module-protocol-ic-ipc.c b/src/module-protocol-ic-ipc.c index 7328d18..d08dc46 100644 --- a/src/module-protocol-ic-ipc.c +++ b/src/module-protocol-ic-ipc.c @@ -34,6 +34,7 @@ struct impl { struct icipc_server *server; struct pw_array clients; + bool suspended; char *pipewire_remote; struct spa_source *timeout_source; @@ -171,6 +172,12 @@ static void on_global_added ( pw_proxy_add_listener((struct pw_proxy*)impl->metadata, &impl->metadata_proxy_listener, &metadata_proxy_events, impl); + + /* sync suspend status */ + if (impl->suspended) + pw_metadata_set_property(impl->metadata, 0, + "suspend.playback", + "Spa:Bool", "1"); } } @@ -239,6 +246,7 @@ static int do_suspend_resume( pw_metadata_set_property(impl->metadata, 0, "suspend.playback", "Spa:Bool", suspend ? "1" : NULL); } + impl->suspended = suspend ? true : false; return 0; } -- cgit 1.2.3-korg