summaryrefslogtreecommitdiffstats
path: root/audio/out
diff options
context:
space:
mode:
authorNicolas F <ovdev@fratti.ch>2020-06-07 23:26:55 +0200
committersfan5 <sfan5@live.de>2023-08-20 20:31:24 +0200
commit5a94c86029a2d0e5452c07a7c12d2a6981f607df (patch)
treeffa101ef2794b33f89328fa23273e5fdb36db9f7 /audio/out
parent9ba8b921cfb3e461958656a2e2d7c1c6c2abb677 (diff)
downloadmpv-5a94c86029a2d0e5452c07a7c12d2a6981f607df.tar.bz2
mpv-5a94c86029a2d0e5452c07a7c12d2a6981f607df.tar.xz
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.
Diffstat (limited to 'audio/out')
-rw-r--r--audio/out/ao_pulse.c1
1 files changed, 1 insertions, 0 deletions
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;