From 1f61472e77faa0b57231b19236272d3e4d67fbc0 Mon Sep 17 00:00:00 2001 From: Chris Robinson Date: Sat, 3 Feb 2018 13:57:04 -0800 Subject: Avoid potentially writing partial samples --- Alc/backends/pulseaudio.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Alc/backends/pulseaudio.c b/Alc/backends/pulseaudio.c index 28858a72..6ba82cd2 100644 --- a/Alc/backends/pulseaudio.c +++ b/Alc/backends/pulseaudio.c @@ -876,8 +876,10 @@ static int ALCpulsePlayback_mixerProc(void *ptr) free_func = pa_xfree; } - aluMixData(device, buf, newlen/frame_size); + newlen /= frame_size; + aluMixData(device, buf, newlen); + newlen *= frame_size; ret = pa_stream_write(self->stream, buf, newlen, free_func, 0, PA_SEEK_RELATIVE); if(ret != PA_OK) { -- cgit v1.2.3