aboutsummaryrefslogtreecommitdiffstats
path: root/Alc/backends/pulseaudio.c
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2018-02-03 13:57:04 -0800
committerChris Robinson <[email protected]>2018-02-03 14:02:47 -0800
commit1f61472e77faa0b57231b19236272d3e4d67fbc0 (patch)
tree6bc58794dba10ae11123debfb0d9198f29b7d8f8 /Alc/backends/pulseaudio.c
parentb99e64a0e3759d326b53578516a4ca5084046e7c (diff)
Avoid potentially writing partial samples
Diffstat (limited to 'Alc/backends/pulseaudio.c')
-rw-r--r--Alc/backends/pulseaudio.c4
1 files changed, 3 insertions, 1 deletions
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)
{