diff options
author | George Kiagiadakis <george.kiagiadakis@collabora.com> | 2021-07-14 12:37:45 +0300 |
---|---|---|
committer | George Kiagiadakis <george.kiagiadakis@collabora.com> | 2021-07-28 13:19:02 +0300 |
commit | 4ad92cc00f6beb6e29c36b7c8316df9b7360903d (patch) | |
tree | 5696e2dea9e0f0f837405b9fa79b7368a1b2fec2 | |
parent | 174faa201f8578ab2dc3517af0cbd9c052d1b546 (diff) |
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 <george.kiagiadakis@collabora.com>
-rw-r--r-- | src/module-protocol-ic-ipc.c | 8 |
1 files changed, 8 insertions, 0 deletions
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; } |