diff options
author | Chris Robinson <[email protected]> | 2021-12-11 17:50:24 -0800 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2021-12-11 17:50:24 -0800 |
commit | 01dd34f305b9ad2c8e6bf0642cd976f9788fdf3a (patch) | |
tree | 75f50acecb284a587e13265efb14ed573af90245 /al/buffer.cpp | |
parent | a75d35bbb06f74e58cb2232d4ca2ce47950f08cd (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/buffer.cpp')
-rw-r--r-- | al/buffer.cpp | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/al/buffer.cpp b/al/buffer.cpp index 550b6247..fe944ead 100644 --- a/al/buffer.cpp +++ b/al/buffer.cpp @@ -522,10 +522,8 @@ void LoadData(ALCcontext *context, ALbuffer *ALBuf, ALsizei freq, ALuint size, SETERR_RETURN(context, AL_INVALID_VALUE,, "Invalid unpack alignment %u for %s samples", unpackalign, NameFromUserFmtType(SrcType)); - const ALuint ambiorder{(*DstChannels == FmtBFormat2D || *DstChannels == FmtBFormat3D) ? - ALBuf->UnpackAmbiOrder : - ((*DstChannels == FmtUHJ2 || *DstChannels == FmtUHJ3 || *DstChannels == FmtUHJ4) ? 1 : - 0)}; + const ALuint ambiorder{IsBFormat(*DstChannels) ? ALBuf->UnpackAmbiOrder : + (IsUHJ(*DstChannels) ? 1 : 0)}; if((access&AL_PRESERVE_DATA_BIT_SOFT)) { @@ -643,10 +641,8 @@ void PrepareCallback(ALCcontext *context, ALbuffer *ALBuf, ALsizei freq, if UNLIKELY(!DstType) SETERR_RETURN(context, AL_INVALID_ENUM,, "Unsupported callback format"); - const ALuint ambiorder{(*DstChannels == FmtBFormat2D || *DstChannels == FmtBFormat3D) ? - ALBuf->UnpackAmbiOrder : - ((*DstChannels == FmtUHJ2 || *DstChannels == FmtUHJ3 || *DstChannels == FmtUHJ4) ? 1 : - 0)}; + const ALuint ambiorder{IsBFormat(*DstChannels) ? ALBuf->UnpackAmbiOrder : + (IsUHJ(*DstChannels) ? 1 : 0)}; constexpr uint line_size{BufferLineSize + MaxPostVoiceLoad}; al::vector<al::byte,16>(FrameSizeFromFmt(*DstChannels, *DstType, ambiorder) * |