diff options
author | Chris Robinson <[email protected]> | 2021-03-31 09:37:30 -0700 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2021-03-31 09:37:30 -0700 |
commit | 35a0f2665f834c107e39ec2dcfc3d9ae0a0b33ce (patch) | |
tree | 5e889ba0dfb6664b9035c856b333f79c5aeecb88 /al/buffer.cpp | |
parent | 8793055e666d2019dd48422c2e4ece1d3118e2f7 (diff) |
Decode UHJ buffers to B-Format for mixing
This should also have an adjustment for the shelf filter. Although it's not
clear what the appropriate adjustments should be.
Diffstat (limited to 'al/buffer.cpp')
-rw-r--r-- | al/buffer.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/al/buffer.cpp b/al/buffer.cpp index f63d5c71..436be9ae 100644 --- a/al/buffer.cpp +++ b/al/buffer.cpp @@ -51,7 +51,9 @@ #include "atomic.h" #include "core/except.h" #include "inprogext.h" +#include "core/logging.h" #include "opthelpers.h" +#include "voice.h" namespace { @@ -503,7 +505,7 @@ void LoadData(ALCcontext *context, ALbuffer *ALBuf, ALsizei freq, ALuint size, unpackalign, NameFromUserFmtType(SrcType)); const ALuint ambiorder{(DstChannels == FmtBFormat2D || DstChannels == FmtBFormat3D) ? - ALBuf->UnpackAmbiOrder : 0}; + ALBuf->UnpackAmbiOrder : ((DstChannels == FmtUHJ2) ? 1 : 0)}; if((access&AL_PRESERVE_DATA_BIT_SOFT)) { @@ -646,10 +648,11 @@ void PrepareCallback(ALCcontext *context, ALbuffer *ALBuf, ALsizei freq, SETERR_RETURN(context, AL_INVALID_ENUM,, "Unsupported callback format"); const ALuint ambiorder{(DstChannels == FmtBFormat2D || DstChannels == FmtBFormat3D) ? - ALBuf->UnpackAmbiOrder : 0}; + ALBuf->UnpackAmbiOrder : ((DstChannels == FmtUHJ2) ? 1 : 0)}; + constexpr uint line_size{BufferLineSize + MaxPostVoiceLoad}; al::vector<al::byte,16>(FrameSizeFromFmt(DstChannels, DstType, ambiorder) * - size_t{BufferLineSize + (MaxResamplerPadding>>1)}).swap(ALBuf->mData); + size_t{line_size}).swap(ALBuf->mData); ALBuf->mCallback = callback; ALBuf->mUserData = userptr; |