diff options
author | Chris Robinson <chris.kcat@gmail.com> | 2020-01-15 10:45:08 -0800 |
---|---|---|
committer | Chris Robinson <chris.kcat@gmail.com> | 2020-01-15 10:45:08 -0800 |
commit | 32c9dbd7ff9bae89ddf876590b938d2932fe609f (patch) | |
tree | b80a5f5e88dda580c29ee4a151b29e5c2ecca23d /alc/panning.cpp | |
parent | 6a8c6eae6f72a31bca2a04e94bc3bc16e10a83be (diff) |
Avoid an extraneous index map
Diffstat (limited to 'alc/panning.cpp')
-rw-r--r-- | alc/panning.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/alc/panning.cpp b/alc/panning.cpp index f7dfa6d0..9a0a4267 100644 --- a/alc/panning.cpp +++ b/alc/panning.cpp @@ -434,7 +434,7 @@ void InitPanning(ALCdevice *device) else { ChannelDec chancoeffs[MAX_OUTPUT_CHANNELS]{}; - ALuint idxmap[MAX_OUTPUT_CHANNELS]{}; + ALuint maxchan{0}; for(size_t i{0u};i < chanmap.size();++i) { const ALuint idx{GetChannelIdxByName(device->RealOut, chanmap[i].ChanName)}; @@ -444,8 +444,8 @@ void InitPanning(ALCdevice *device) GetLabelFromChannel(chanmap[i].ChanName)); continue; } - idxmap[i] = idx; - std::copy_n(chanmap[i].Config, coeffcount, chancoeffs[i]); + maxchan = maxu(maxchan, idx); + std::copy_n(chanmap[i].Config, coeffcount, chancoeffs[idx]); } /* For non-DevFmtAmbi3D, set the ambisonic order given the mixing @@ -464,8 +464,8 @@ void InitPanning(ALCdevice *device) (coeffcount > 5) ? "third" : (coeffcount > 3) ? "second" : "first", ""); - device->AmbiDecoder = BFormatDec::Create(coeffcount, chancoeffs, - al::span<const ALuint>{idxmap, chanmap.size()}); + device->AmbiDecoder = BFormatDec::Create(coeffcount, + al::span<const ChannelDec>{chancoeffs, maxchan}); } } |