aboutsummaryrefslogtreecommitdiffstats
path: root/alc/backends/oboe.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/oboe.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/oboe.cpp')
-rw-r--r--alc/backends/oboe.cpp36
1 files changed, 6 insertions, 30 deletions
diff --git a/alc/backends/oboe.cpp b/alc/backends/oboe.cpp
index ddc3f0b9..aefda974 100644
--- a/alc/backends/oboe.cpp
+++ b/alc/backends/oboe.cpp
@@ -131,38 +131,15 @@ bool OboePlayback::reset()
mStream->getBufferCapacityInFrames()));
TRACE("Got stream with properties:\n%s", oboe::convertToText(mStream.get()));
- switch(mStream->getChannelCount())
+ if(static_cast<uint>(mStream->getChannelCount()) != mDevice->channelsFromFmt())
{
- case oboe::ChannelCount::Mono:
- mDevice->FmtChans = DevFmtMono;
- break;
- case oboe::ChannelCount::Stereo:
- mDevice->FmtChans = DevFmtStereo;
- break;
- /* Other potential configurations. Could be wrong, but better than failing.
- * Assume WFX channel order.
- */
- case 4:
- mDevice->FmtChans = DevFmtQuad;
- break;
- case 6:
- mDevice->FmtChans = DevFmtX51Rear;
- break;
- case 7:
- mDevice->FmtChans = DevFmtX61;
- break;
- case 8:
- mDevice->FmtChans = DevFmtX71;
- break;
- default:
- if(mStream->getChannelCount() < 1)
+ if(mStream->getChannelCount() >= 2)
+ mDevice->FmtChans = DevFmtStereo;
+ else if(mStream->getChannelCount() == 1)
+ mDevice->FmtChans = DevFmtMono;
+ else
throw al::backend_exception{al::backend_error::DeviceError,
"Got unhandled channel count: %d", mStream->getChannelCount()};
- /* Assume first two channels are front left/right. We can do a stereo
- * mix and keep the other channels silent.
- */
- mDevice->FmtChans = DevFmtStereo;
- break;
}
setDefaultWFXChannelOrder();
@@ -252,7 +229,6 @@ void OboeCapture::open(const char *name)
break;
case DevFmtQuad:
case DevFmtX51:
- case DevFmtX51Rear:
case DevFmtX61:
case DevFmtX71:
case DevFmtAmbi3D: