aboutsummaryrefslogtreecommitdiffstats
path: root/al/source.cpp
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2021-12-11 17:50:24 -0800
committerChris Robinson <[email protected]>2021-12-11 17:50:24 -0800
commit01dd34f305b9ad2c8e6bf0642cd976f9788fdf3a (patch)
tree75f50acecb284a587e13265efb14ed573af90245 /al/source.cpp
parenta75d35bbb06f74e58cb2232d4ca2ce47950f08cd (diff)
Add an internal Super Stereo format
It's not available as an AL buffer format (yet) since I'm not sure how to expose it. Internally it seems fine as a separate channel configuration, but because OpenAL combines the channel configuration and sample type, a flag may work better there.
Diffstat (limited to 'al/source.cpp')
-rw-r--r--al/source.cpp9
1 files changed, 3 insertions, 6 deletions
diff --git a/al/source.cpp b/al/source.cpp
index 7ba08970..d8584956 100644
--- a/al/source.cpp
+++ b/al/source.cpp
@@ -496,10 +496,8 @@ void InitVoice(Voice *voice, ALsource *source, ALbufferQueueItem *BufferList, AL
voice->mFmtType = buffer->mType;
voice->mNumChannels = buffer->channelsFromFmt();
voice->mFrameSize = buffer->frameSizeFromFmt();
- voice->mAmbiLayout = (buffer->mChannels == FmtUHJ2 || buffer->mChannels == FmtUHJ3
- || buffer->mChannels == FmtUHJ4) ? AmbiLayout::FuMa : buffer->mAmbiLayout;
- voice->mAmbiScaling = (buffer->mChannels == FmtUHJ2 || buffer->mChannels == FmtUHJ3
- || buffer->mChannels == FmtUHJ4) ? AmbiScaling::UHJ : buffer->mAmbiScaling;
+ voice->mAmbiLayout = buffer->isUhj() ? AmbiLayout::FuMa : buffer->mAmbiLayout;
+ voice->mAmbiScaling = buffer->isUhj() ? AmbiScaling::UHJ : buffer->mAmbiScaling;
voice->mAmbiOrder = buffer->mAmbiOrder;
if(buffer->mCallback) voice->mFlags |= VoiceIsCallback;
@@ -509,8 +507,7 @@ void InitVoice(Voice *voice, ALsource *source, ALbufferQueueItem *BufferList, AL
/* Even if storing really high order ambisonics, we only mix channels for
* orders up to MaxAmbiOrder. The rest are simply dropped.
*/
- ALuint num_channels{(buffer->mChannels == FmtUHJ2) ? 3 :
- ChannelsFromFmt(buffer->mChannels, minu(buffer->mAmbiOrder, MaxAmbiOrder))};
+ ALuint num_channels{buffer->mixerChannelsFromFmt()};
if UNLIKELY(num_channels > device->mSampleData.size())
{
ERR("Unexpected channel count: %u (limit: %zu, %d:%d)\n", num_channels,