diff options
author | Aman Karmani <aman@tmm1.net> | 2021-10-19 14:39:48 -0700 |
---|---|---|
committer | sfan5 <sfan5@live.de> | 2021-10-21 17:20:51 +0200 |
commit | 06392e7ec12c35961a3e09115ec881d2a19407ad (patch) | |
tree | eeb9561c54406c533d7b915da2f463fbf0aa1a12 | |
parent | fa691e0f694b6d541a2b86f3866cfd2985358adf (diff) | |
download | mpv-06392e7ec12c35961a3e09115ec881d2a19407ad.tar.bz2 mpv-06392e7ec12c35961a3e09115ec881d2a19407ad.tar.xz |
ao_audiotrack: change buffer sizing logic
Previously number of channels was being ignored.
The buffer will now be between 75ms and 150ms
Signed-off-by: Aman Karmani <aman@tmm1.net>
-rw-r--r-- | audio/out/ao_audiotrack.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/audio/out/ao_audiotrack.c b/audio/out/ao_audiotrack.c index 3ddd559ffe..fbbdaa1c7a 100644 --- a/audio/out/ao_audiotrack.c +++ b/audio/out/ao_audiotrack.c @@ -721,8 +721,8 @@ static int init(struct ao *ao) return -1; } - int min = 0.200 * p->samplerate * af_fmt_to_bytes(ao->format); - int max = min * 3 / 2; + int min = 0.075 * p->samplerate * af_fmt_to_bytes(ao->format) * ao->channels.num; + int max = min * 2; p->size = MPCLAMP(buffer_size * 2, min, max); MP_VERBOSE(ao, "Setting bufferSize = %d (driver=%d, min=%d, max=%d)\n", p->size, buffer_size, min, max); ao->device_buffer = p->size / af_fmt_to_bytes(ao->format); |