From 2e6a55a87ce24a9303c3039609b41fb0eb302483 Mon Sep 17 00:00:00 2001 From: Chris Robinson Date: Sat, 21 Dec 2019 20:43:46 -0800 Subject: Handle padding between device sample frames The padding must be constant and sample type aligned (e.g. some fixed multiple of two bytes between the start of two consecutive frames for 16-bit output). The intent is to always have the ability for stereo output with WASAPI even if the device has some other unsupported configuration, as long as front-left and front-right exist. --- alc/backends/pulseaudio.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'alc/backends/pulseaudio.cpp') diff --git a/alc/backends/pulseaudio.cpp b/alc/backends/pulseaudio.cpp index 4e46460b..be4e742c 100644 --- a/alc/backends/pulseaudio.cpp +++ b/alc/backends/pulseaudio.cpp @@ -763,7 +763,7 @@ void PulsePlayback::streamStateCallback(pa_stream *stream) noexcept void PulsePlayback::streamWriteCallback(pa_stream *stream, size_t nbytes) noexcept { void *buf{pa_xmalloc(nbytes)}; - aluMixData(mDevice, buf, static_cast(nbytes/mFrameSize)); + aluMixData(mDevice, buf, static_cast(nbytes/mFrameSize), mDevice->channelsFromFmt()); int ret{pa_stream_write(stream, buf, nbytes, pa_xfree, 0, PA_SEEK_RELATIVE)}; if UNLIKELY(ret != PA_OK) -- cgit v1.2.3