From dbc1e3a4597f8740e4885c879ebbe390d3ef72af Mon Sep 17 00:00:00 2001 From: Misaki Kasumi Date: Tue, 26 Mar 2024 04:08:13 +0800 Subject: [PATCH] ao_avfoundation: support set_pause --- audio/out/ao_avfoundation.m | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/audio/out/ao_avfoundation.m b/audio/out/ao_avfoundation.m index 3ec11c4fdf..7654916519 100644 --- a/audio/out/ao_avfoundation.m +++ b/audio/out/ao_avfoundation.m @@ -159,6 +159,19 @@ static void stop(struct ao *ao) }); } +static bool set_pause(struct ao *ao, bool paused) +{ + struct priv *p = ao->priv; + + if (paused) { + [p->synchronizer setRate:0]; + } else { + [p->synchronizer setRate:1]; + } + + return true; +} + static int control(struct ao *ao, enum aocontrol cmd, void *arg) { struct priv *p = ao->priv; @@ -353,6 +366,7 @@ const struct ao_driver audio_out_avfoundation = { .control = control, .reset = stop, .start = start, + .set_pause = set_pause, .list_devs = ca_get_device_list, .priv_size = sizeof(struct priv), };