ao_avfoundation: support set_pause

This commit is contained in:
Misaki Kasumi 2024-03-26 04:08:13 +08:00 committed by sfan5
parent 93a924a553
commit dbc1e3a459
1 changed files with 14 additions and 0 deletions

View File

@ -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),
};