diff options
author | Misaki Kasumi <misakikasumi@outlook.com> | 2024-03-26 04:08:13 +0800 |
---|---|---|
committer | sfan5 <sfan5@live.de> | 2024-04-03 23:40:05 +0200 |
commit | dbc1e3a4597f8740e4885c879ebbe390d3ef72af (patch) | |
tree | bbc1d05ee190259fdab619df0ad1c8c28aebedf9 /audio/out | |
parent | 93a924a5538afd4a6f98878c8ae16f17ee80b958 (diff) | |
download | mpv-dbc1e3a4597f8740e4885c879ebbe390d3ef72af.tar.bz2 mpv-dbc1e3a4597f8740e4885c879ebbe390d3ef72af.tar.xz |
ao_avfoundation: support set_pause
Diffstat (limited to 'audio/out')
-rw-r--r-- | audio/out/ao_avfoundation.m | 14 |
1 files changed, 14 insertions, 0 deletions
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), }; |