From 5a94c86029a2d0e5452c07a7c12d2a6981f607df Mon Sep 17 00:00:00 2001 From: Nicolas F Date: Sun, 7 Jun 2020 23:26:55 +0200 Subject: ao/pulse: implement period_size The idea behind period_size is that it's the minimum amount of data that your audio subsystem wants to fetch. For PulseAudio, this is given by the minreq buffer attribute, which is in bytes for all channels. Hence the divisions. --- audio/out/ao_pulse.c | 1 + 1 file changed, 1 insertion(+) diff --git a/audio/out/ao_pulse.c b/audio/out/ao_pulse.c index ae19c875c0..007b1c5155 100644 --- a/audio/out/ao_pulse.c +++ b/audio/out/ao_pulse.c @@ -473,6 +473,7 @@ static int init(struct ao *ao) } ao->device_buffer = final_bufattr->tlength / af_fmt_to_bytes(ao->format) / ao->channels.num; + ao->period_size = final_bufattr->minreq / af_fmt_to_bytes(ao->format) / ao->channels.num; pa_threaded_mainloop_unlock(priv->mainloop); return 0; -- cgit v1.2.3