From 43780913cd8eec5f81626850055f60442b2bce2a Mon Sep 17 00:00:00 2001 From: Chris Robinson Date: Sun, 19 Jan 2020 13:40:39 -0800 Subject: Fix the output channel count for the B-Format decoder --- alc/panning.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'alc/panning.cpp') 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{chancoeffs, maxchan}); + al::span{chancoeffs, outcount}); } } -- cgit v1.2.3