aboutsummaryrefslogtreecommitdiffstats
path: root/alc/backends/base.cpp
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2021-07-30 07:38:26 -0700
committerChris Robinson <[email protected]>2021-07-30 07:38:26 -0700
commit29fba79cd5dd06888da22c7fc18779062c28fc3a (patch)
tree1548234679191873024c7ead9eb07c6088885b7e /alc/backends/base.cpp
parent486eca8ce68e15fa5fff6a53d410aee9251245dd (diff)
Avoid 5.1Rear as its own channel configuration
It messes with 5.1 sources using direct channels, and the surround channels are supposed to map to the side labels. Individual backends can deal with the channel order/label differences, as they already do to a degree.
Diffstat (limited to 'alc/backends/base.cpp')
-rw-r--r--alc/backends/base.cpp22
1 files changed, 10 insertions, 12 deletions
diff --git a/alc/backends/base.cpp b/alc/backends/base.cpp
index 0c28d238..dea29a80 100644
--- a/alc/backends/base.cpp
+++ b/alc/backends/base.cpp
@@ -79,14 +79,6 @@ void BackendBase::setDefaultWFXChannelOrder()
mDevice->RealOut.ChannelIndex[SideLeft] = 4;
mDevice->RealOut.ChannelIndex[SideRight] = 5;
break;
- case DevFmtX51Rear:
- mDevice->RealOut.ChannelIndex[FrontLeft] = 0;
- mDevice->RealOut.ChannelIndex[FrontRight] = 1;
- mDevice->RealOut.ChannelIndex[FrontCenter] = 2;
- mDevice->RealOut.ChannelIndex[LFE] = 3;
- mDevice->RealOut.ChannelIndex[BackLeft] = 4;
- mDevice->RealOut.ChannelIndex[BackRight] = 5;
- break;
case DevFmtX61:
mDevice->RealOut.ChannelIndex[FrontLeft] = 0;
mDevice->RealOut.ChannelIndex[FrontRight] = 1;
@@ -117,11 +109,11 @@ void BackendBase::setDefaultChannelOrder()
switch(mDevice->FmtChans)
{
- case DevFmtX51Rear:
+ case DevFmtX51:
mDevice->RealOut.ChannelIndex[FrontLeft] = 0;
mDevice->RealOut.ChannelIndex[FrontRight] = 1;
- mDevice->RealOut.ChannelIndex[BackLeft] = 2;
- mDevice->RealOut.ChannelIndex[BackRight] = 3;
+ mDevice->RealOut.ChannelIndex[SideLeft] = 2;
+ mDevice->RealOut.ChannelIndex[SideRight] = 3;
mDevice->RealOut.ChannelIndex[FrontCenter] = 4;
mDevice->RealOut.ChannelIndex[LFE] = 5;
return;
@@ -140,7 +132,6 @@ void BackendBase::setDefaultChannelOrder()
case DevFmtMono:
case DevFmtStereo:
case DevFmtQuad:
- case DevFmtX51:
case DevFmtX61:
case DevFmtAmbi3D:
setDefaultWFXChannelOrder();
@@ -151,6 +142,13 @@ void BackendBase::setDefaultChannelOrder()
#ifdef _WIN32
void BackendBase::setChannelOrderFromWFXMask(uint chanmask)
{
+ constexpr uint x51{SPEAKER_FRONT_LEFT | SPEAKER_FRONT_RIGHT | SPEAKER_FRONT_CENTER
+ | SPEAKER_LOW_FREQUENCY | SPEAKER_SIDE_LEFT | SPEAKER_SIDE_RIGHT};
+ constexpr uint x51rear{SPEAKER_FRONT_LEFT | SPEAKER_FRONT_RIGHT | SPEAKER_FRONT_CENTER
+ | SPEAKER_LOW_FREQUENCY | SPEAKER_BACK_LEFT | SPEAKER_BACK_RIGHT};
+ /* Swap a 5.1 mask using the back channels for one with the sides. */
+ if(chanmask == x51rear) chanmask = x51;
+
auto get_channel = [](const DWORD chanbit) noexcept -> al::optional<Channel>
{
switch(chanbit)