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.
This commit is contained in:
Nicolas F 2020-06-07 23:26:55 +02:00 committed by sfan5
parent 9ba8b921cf
commit 5a94c86029
1 changed files with 1 additions and 0 deletions

View File

@ -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;