From bd0144065a343c936b6a12be6e546e114575217b Mon Sep 17 00:00:00 2001 From: Chris Robinson Date: Mon, 15 Jun 2020 18:50:59 -0700 Subject: Set channel labels from WFX channel masks --- alc/backends/winmm.cpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'alc/backends/winmm.cpp') diff --git a/alc/backends/winmm.cpp b/alc/backends/winmm.cpp index e1261969..4dd74705 100644 --- a/alc/backends/winmm.cpp +++ b/alc/backends/winmm.cpp @@ -28,6 +28,7 @@ #include #include +#include #include #include @@ -263,7 +264,7 @@ bool WinMMPlayback::reset() { mDevice->BufferSize = static_cast(uint64_t{mDevice->BufferSize} * mFormat.nSamplesPerSec / mDevice->Frequency); - mDevice->BufferSize = (mDevice->BufferSize+3) & ~0x3; + mDevice->BufferSize = (mDevice->BufferSize+3) & ~0x3u; mDevice->UpdateSize = mDevice->BufferSize / 4; mDevice->Frequency = mFormat.nSamplesPerSec; @@ -295,16 +296,23 @@ bool WinMMPlayback::reset() return false; } + ALuint chanmask{}; if(mFormat.nChannels == 2) + { mDevice->FmtChans = DevFmtStereo; + chanmask = SPEAKER_FRONT_LEFT | SPEAKER_FRONT_RIGHT; + } else if(mFormat.nChannels == 1) + { mDevice->FmtChans = DevFmtMono; + chanmask = SPEAKER_FRONT_CENTER; + } else { ERR("Unhandled channel count: %d\n", mFormat.nChannels); return false; } - setDefaultWFXChannelOrder(); + setChannelOrderFromWFXMask(chanmask); ALuint BufferSize{mDevice->UpdateSize * mDevice->frameSizeFromFmt()}; -- cgit v1.2.3