diff options
author | Chris Robinson <[email protected]> | 2019-02-20 21:01:08 -0800 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2019-02-20 21:01:08 -0800 |
commit | c43381d811f436187b99c51951365c33fc735dc5 (patch) | |
tree | d7c542ccf07bd04f45902b4dfa1f5cf401951ce5 /Alc/alc.cpp | |
parent | 77ba61ecb3973dab4fff5fdc8bc237a6f4cd0056 (diff) |
Allocate the effect slot wet buffer dynamically
Diffstat (limited to 'Alc/alc.cpp')
-rw-r--r-- | Alc/alc.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/Alc/alc.cpp b/Alc/alc.cpp index a08b1261..55104f9e 100644 --- a/Alc/alc.cpp +++ b/Alc/alc.cpp @@ -2068,8 +2068,9 @@ static ALCenum UpdateDeviceParams(ALCdevice *device, const ALCint *attrList) if(context->DefaultSlot) { ALeffectslot *slot = context->DefaultSlot.get(); - EffectState *state = slot->Effect.State; + aluInitEffectPanning(slot); + EffectState *state{slot->Effect.State}; state->mOutBuffer = device->Dry.Buffer; state->mOutChannels = device->Dry.NumChannels; if(state->deviceUpdate(device) == AL_FALSE) @@ -2082,8 +2083,10 @@ static ALCenum UpdateDeviceParams(ALCdevice *device, const ALCint *attrList) std::unique_lock<std::mutex> slotlock{context->EffectSlotLock}; for(auto &slot : context->EffectSlotList) { - EffectState *state = slot->Effect.State; + if(!slot) continue; + aluInitEffectPanning(slot.get()); + EffectState *state{slot->Effect.State}; state->mOutBuffer = device->Dry.Buffer; state->mOutChannels = device->Dry.NumChannels; if(state->deviceUpdate(device) == AL_FALSE) |