From 01dd34f305b9ad2c8e6bf0642cd976f9788fdf3a Mon Sep 17 00:00:00 2001 From: Chris Robinson Date: Sat, 11 Dec 2021 17:50:24 -0800 Subject: 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. --- al/source.cpp | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'al/source.cpp') 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, -- cgit v1.2.3