aboutsummaryrefslogtreecommitdiffstats
path: root/alc/panning.cpp
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2020-01-19 13:40:39 -0800
committerChris Robinson <[email protected]>2020-01-19 13:40:39 -0800
commit43780913cd8eec5f81626850055f60442b2bce2a (patch)
treeee60d0b745243b9a085d99a1b87b1cbdc0d7623d /alc/panning.cpp
parent3904289af7d4693a04c02d8739118182de56df96 (diff)
Fix the output channel count for the B-Format decoder
Diffstat (limited to 'alc/panning.cpp')
-rw-r--r--alc/panning.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/alc/panning.cpp b/alc/panning.cpp
index 9a0a4267..435555d2 100644
--- a/alc/panning.cpp
+++ b/alc/panning.cpp
@@ -434,7 +434,7 @@ void InitPanning(ALCdevice *device)
else
{
ChannelDec chancoeffs[MAX_OUTPUT_CHANNELS]{};
- ALuint maxchan{0};
+ ALuint outcount{0};
for(size_t i{0u};i < chanmap.size();++i)
{
const ALuint idx{GetChannelIdxByName(device->RealOut, chanmap[i].ChanName)};
@@ -444,7 +444,7 @@ void InitPanning(ALCdevice *device)
GetLabelFromChannel(chanmap[i].ChanName));
continue;
}
- maxchan = maxu(maxchan, idx);
+ outcount = maxu(outcount, idx+1u);
std::copy_n(chanmap[i].Config, coeffcount, chancoeffs[idx]);
}
@@ -465,7 +465,7 @@ void InitPanning(ALCdevice *device)
(coeffcount > 3) ? "second" : "first",
"");
device->AmbiDecoder = BFormatDec::Create(coeffcount,
- al::span<const ChannelDec>{chancoeffs, maxchan});
+ al::span<const ChannelDec>{chancoeffs, outcount});
}
}