From 93a94d177c4bb0b9c8feb85420a388d32df4cc8f Mon Sep 17 00:00:00 2001 From: Chris Robinson Date: Fri, 13 May 2016 18:28:01 -0700 Subject: Get rid of an unnecessary copy of ALeffectProps --- Alc/ALu.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'Alc/ALu.c') diff --git a/Alc/ALu.c b/Alc/ALu.c index 6f4db05e..6ae89b89 100644 --- a/Alc/ALu.c +++ b/Alc/ALu.c @@ -341,12 +341,11 @@ static ALboolean CalcEffectSlotParams(ALeffectslot *slot, ALCdevice *device) slot->Params.Gain = ATOMIC_LOAD(&props->Gain, almemory_order_relaxed); slot->Params.AuxSendAuto = ATOMIC_LOAD(&props->AuxSendAuto, almemory_order_relaxed); slot->Params.EffectType = ATOMIC_LOAD(&props->Type, almemory_order_relaxed); - memcpy(&slot->Params.EffectProps, &props->Props, sizeof(props->Props)); if(IsReverbEffect(slot->Params.EffectType)) { - slot->Params.RoomRolloff = slot->Params.EffectProps.Reverb.RoomRolloffFactor; - slot->Params.DecayTime = slot->Params.EffectProps.Reverb.DecayTime; - slot->Params.AirAbsorptionGainHF = slot->Params.EffectProps.Reverb.AirAbsorptionGainHF; + slot->Params.RoomRolloff = props->Props.Reverb.RoomRolloffFactor; + slot->Params.DecayTime = props->Props.Reverb.DecayTime; + slot->Params.AirAbsorptionGainHF = props->Props.Reverb.AirAbsorptionGainHF; } else { @@ -362,6 +361,8 @@ static ALboolean CalcEffectSlotParams(ALeffectslot *slot, ALCdevice *device) &props->State, slot->Params.EffectState, almemory_order_relaxed ); + V(slot->Params.EffectState,update)(device, slot, &props->Props); + /* WARNING: A livelock is theoretically possible if another thread keeps * changing the freelist head without giving this a chance to actually swap * in the old container (practically impossible with this little code, @@ -373,8 +374,6 @@ static ALboolean CalcEffectSlotParams(ALeffectslot *slot, ALCdevice *device) } while(ATOMIC_COMPARE_EXCHANGE_WEAK(struct ALeffectslotProps*, &slot->FreeList, &first, props) == 0); - V(slot->Params.EffectState,update)(device, slot); - return AL_TRUE; } -- cgit v1.2.3