From 2407e1b2d095611db1e61fca781b45ba389e8788 Mon Sep 17 00:00:00 2001 From: Misaki Kasumi Date: Tue, 26 Mar 2024 21:57:12 +0800 Subject: [PATCH] ao_pipewire: support set_pause --- audio/out/ao_pipewire.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/audio/out/ao_pipewire.c b/audio/out/ao_pipewire.c index a03f172529..9e08ddc626 100644 --- a/audio/out/ao_pipewire.c +++ b/audio/out/ao_pipewire.c @@ -693,6 +693,15 @@ static void start(struct ao *ao) pw_thread_loop_unlock(p->loop); } +static bool set_pause(struct ao *ao, bool paused) +{ + struct priv *p = ao->priv; + pw_thread_loop_lock(p->loop); + pw_stream_set_active(p->stream, !paused); + pw_thread_loop_unlock(p->loop); + return true; +} + #define CONTROL_RET(r) (!r ? CONTROL_OK : CONTROL_ERROR) static int control(struct ao *ao, enum aocontrol cmd, void *arg) @@ -884,7 +893,7 @@ const struct ao_driver audio_out_pipewire = { .uninit = uninit, .reset = reset, .start = start, - + .set_pause = set_pause, .control = control, .hotplug_init = hotplug_init,