diff options
author | Chris Robinson <[email protected]> | 2011-09-11 00:58:33 -0700 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2011-09-11 00:58:33 -0700 |
commit | 89f438df71bc757c96fd2c3660f67f5bcf684075 (patch) | |
tree | de5385033de43bc127d56f1c805f68d92c0cd24a /OpenAL32 | |
parent | 97027a7ad9815435b2e06f3e755c9dea74d56731 (diff) |
Small fixes to setting the source's direct filter and auxiliary send
Diffstat (limited to 'OpenAL32')
-rw-r--r-- | OpenAL32/alSource.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/OpenAL32/alSource.c b/OpenAL32/alSource.c index 110b504a..879f4377 100644 --- a/OpenAL32/alSource.c +++ b/OpenAL32/alSource.c @@ -663,6 +663,7 @@ AL_API ALvoid AL_APIENTRY alSourcei(ALuint source,ALenum eParam,ALint lValue) if(lValue == 0 || (filter=LookupFilter(pContext->Device->FilterMap, lValue)) != NULL) { + LockContext(pContext); if(!filter) { Source->DirectGain = 1.0f; @@ -673,6 +674,7 @@ AL_API ALvoid AL_APIENTRY alSourcei(ALuint source,ALenum eParam,ALint lValue) Source->DirectGain = filter->Gain; Source->DirectGainHF = filter->GainHF; } + UnlockContext(pContext); Source->NeedsUpdate = AL_TRUE; } else @@ -784,11 +786,9 @@ AL_API void AL_APIENTRY alSource3i(ALuint source, ALenum eParam, ALint lValue1, { /* Release refcount on the previous slot, and add one for * the new slot */ - if(Source->Send[lValue2].Slot) - DecrementRef(&Source->Send[lValue2].Slot->ref); - Source->Send[lValue2].Slot = ALEffectSlot; - if(Source->Send[lValue2].Slot) - IncrementRef(&Source->Send[lValue2].Slot->ref); + if(ALEffectSlot) IncrementRef(&ALEffectSlot->ref); + ALEffectSlot = ExchangePtr((void**)&Source->Send[lValue2].Slot, ALEffectSlot); + if(ALEffectSlot) DecrementRef(&ALEffectSlot->ref); if(!ALFilter) { |