diff options
author | Chris Robinson <[email protected]> | 2020-12-25 08:31:02 -0800 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2020-12-25 08:31:02 -0800 |
commit | 78f73a42770f436218fc40b85ff804b301201df1 (patch) | |
tree | 341dd48ba1897614676a6190a231534e36a7073e /alc/bformatdec.cpp | |
parent | eaf209d2f17e0c5675c1e17fe67d44ac0ef382a0 (diff) |
Avoid dynamic vectors in AmbDecConf
Also add a bit more sanity checking
Diffstat (limited to 'alc/bformatdec.cpp')
-rw-r--r-- | alc/bformatdec.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/alc/bformatdec.cpp b/alc/bformatdec.cpp index 0aa65af8..64c45b68 100644 --- a/alc/bformatdec.cpp +++ b/alc/bformatdec.cpp @@ -66,10 +66,10 @@ BFormatDec::BFormatDec(const AmbDecConf *conf, const bool allow_2band, const siz if(!(conf->ChanMask&(1u<<acn))) continue; const size_t order{AmbiIndex::OrderFromChannel[acn]}; const float gain{conf->HFOrderGain[order] / coeff_scale[acn]}; - for(size_t i{0u};i < conf->Speakers.size();++i) + for(size_t i{0u};i < conf->NumSpeakers;++i) { const size_t chanidx{chanmap[i]}; - mChannelDec[j].mGains.Single[chanidx] = conf->HFMatrix[i][k] * gain; + mChannelDec[j].mGains.Single[chanidx] = conf->Matrix[i][k] * gain; } ++k; } @@ -88,7 +88,7 @@ BFormatDec::BFormatDec(const AmbDecConf *conf, const bool allow_2band, const siz const size_t order{AmbiIndex::OrderFromChannel[acn]}; const float hfGain{conf->HFOrderGain[order] * ratio / coeff_scale[acn]}; const float lfGain{conf->LFOrderGain[order] / ratio / coeff_scale[acn]}; - for(size_t i{0u};i < conf->Speakers.size();++i) + for(size_t i{0u};i < conf->NumSpeakers;++i) { const size_t chanidx{chanmap[i]}; mChannelDec[j].mGains.Dual[sHFBand][chanidx] = conf->HFMatrix[i][k] * hfGain; |