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/portaudio.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'alc/backends/portaudio.cpp') diff --git a/alc/backends/portaudio.cpp b/alc/backends/portaudio.cpp index 1e3d0ce8..5de9ab58 100644 --- a/alc/backends/portaudio.cpp +++ b/alc/backends/portaudio.cpp @@ -110,7 +110,8 @@ int PortPlayback::writeCallback(const void*, void *outputBuffer, unsigned long f const PaStreamCallbackTimeInfo*, const PaStreamCallbackFlags) noexcept { std::lock_guard _{*this}; - aluMixData(mDevice, outputBuffer, static_cast(framesPerBuffer)); + aluMixData(mDevice, outputBuffer, static_cast(framesPerBuffer), + mDevice->channelsFromFmt()); return 0; } -- cgit v1.2.3