diff options
author | Chris Robinson <[email protected]> | 2019-12-21 20:43:46 -0800 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2019-12-21 20:43:46 -0800 |
commit | 2e6a55a87ce24a9303c3039609b41fb0eb302483 (patch) | |
tree | f3bb706cac1689ac9233da4bdd78a9530b5c078a /alc/backends/dsound.cpp | |
parent | c2ca617ed60e26878a6ac10aaf0dc644b6a24d29 (diff) |
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.
Diffstat (limited to 'alc/backends/dsound.cpp')
-rw-r--r-- | alc/backends/dsound.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/alc/backends/dsound.cpp b/alc/backends/dsound.cpp index c04ba9e4..69fb5fb0 100644 --- a/alc/backends/dsound.cpp +++ b/alc/backends/dsound.cpp @@ -219,6 +219,7 @@ FORCE_ALIGN int DSoundPlayback::mixerProc() return 1; } + const size_t FrameStep{mDevice->channelsFromFmt()}; ALuint FrameSize{mDevice->frameSizeFromFmt()}; DWORD FragSize{mDevice->UpdateSize * FrameSize}; @@ -276,9 +277,9 @@ FORCE_ALIGN int DSoundPlayback::mixerProc() if(SUCCEEDED(err)) { std::unique_lock<DSoundPlayback> dlock{*this}; - aluMixData(mDevice, WritePtr1, WriteCnt1/FrameSize); + aluMixData(mDevice, WritePtr1, WriteCnt1/FrameSize, FrameStep); if(WriteCnt2 > 0) - aluMixData(mDevice, WritePtr2, WriteCnt2/FrameSize); + aluMixData(mDevice, WritePtr2, WriteCnt2/FrameSize, FrameStep); dlock.unlock(); mBuffer->Unlock(WritePtr1, WriteCnt1, WritePtr2, WriteCnt2); |