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/oss.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/oss.cpp')
-rw-r--r-- | alc/backends/oss.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/alc/backends/oss.cpp b/alc/backends/oss.cpp index 59cc44e4..b3f8936a 100644 --- a/alc/backends/oss.cpp +++ b/alc/backends/oss.cpp @@ -277,6 +277,7 @@ int OSSPlayback::mixerProc() SetRTPriority(); althrd_setname(MIXER_THREAD_NAME); + const size_t frame_step{mDevice->channelsFromFmt()}; const ALuint frame_size{mDevice->frameSizeFromFmt()}; std::unique_lock<OSSPlayback> dlock{*this}; @@ -306,7 +307,7 @@ int OSSPlayback::mixerProc() ALubyte *write_ptr{mMixData.data()}; size_t to_write{mMixData.size()}; - aluMixData(mDevice, write_ptr, static_cast<ALuint>(to_write/frame_size)); + aluMixData(mDevice, write_ptr, static_cast<ALuint>(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)}; |