mirror of
https://github.com/mpv-player/mpv
synced 2025-03-02 20:28:02 +00:00
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:
parent
9ba8b921cf
commit
5a94c86029
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user