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/solaris.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'alc/backends/solaris.cpp') diff --git a/alc/backends/solaris.cpp b/alc/backends/solaris.cpp index 7cc2606e..6823777c 100644 --- a/alc/backends/solaris.cpp +++ b/alc/backends/solaris.cpp @@ -89,6 +89,7 @@ int SolarisBackend::mixerProc() SetRTPriority(); althrd_setname(MIXER_THREAD_NAME); + const size_t frame_step{mDevice->channelsFromFmt()}; const ALuint frame_size{mDevice->frameSizeFromFmt()}; std::unique_lock dlock{*this}; @@ -119,7 +120,7 @@ int SolarisBackend::mixerProc() ALubyte *write_ptr{mBuffer.data()}; size_t to_write{mBuffer.size()}; - aluMixData(mDevice, write_ptr, to_write/frame_size); + aluMixData(mDevice, write_ptr, to_write/frame_size, frame_step); while(to_write > 0 && !mKillNow.load(std::memory_order_acquire)) { ssize_t wrote{write(mFd, write_ptr, to_write)}; -- cgit v1.2.3