diff options
author | Chris Robinson <[email protected]> | 2016-05-13 20:21:20 -0700 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2016-05-13 20:21:20 -0700 |
commit | f751f5e25e2a6451dc68ecf091ea5a6d57513679 (patch) | |
tree | c1257f43cb6af64466953ae7054a843bbbe8a285 /OpenAL32/alState.c | |
parent | 93a94d177c4bb0b9c8feb85420a388d32df4cc8f (diff) |
Store the remaining context properties with the listener properties
Diffstat (limited to 'OpenAL32/alState.c')
-rw-r--r-- | OpenAL32/alState.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/OpenAL32/alState.c b/OpenAL32/alState.c index 899dacd4..c0c2ca82 100644 --- a/OpenAL32/alState.c +++ b/OpenAL32/alState.c @@ -52,6 +52,7 @@ AL_API ALvoid AL_APIENTRY alEnable(ALenum capability) context = GetContextRef(); if(!context) return; + WriteLock(&context->PropLock); switch(capability) { case AL_SOURCE_DISTANCE_MODEL: @@ -61,12 +62,10 @@ AL_API ALvoid AL_APIENTRY alEnable(ALenum capability) default: SET_ERROR_AND_GOTO(context, AL_INVALID_ENUM, done); } - /* HACK: Force sources to update by doing a listener update */ - ReadLock(&context->PropLock); UpdateListenerProps(context); - ReadUnlock(&context->PropLock); done: + WriteUnlock(&context->PropLock); ALCcontext_DecRef(context); } @@ -77,6 +76,7 @@ AL_API ALvoid AL_APIENTRY alDisable(ALenum capability) context = GetContextRef(); if(!context) return; + WriteLock(&context->PropLock); switch(capability) { case AL_SOURCE_DISTANCE_MODEL: @@ -86,12 +86,10 @@ AL_API ALvoid AL_APIENTRY alDisable(ALenum capability) default: SET_ERROR_AND_GOTO(context, AL_INVALID_ENUM, done); } - /* HACK: Force sources to update by doing a listener update */ - ReadLock(&context->PropLock); UpdateListenerProps(context); - ReadUnlock(&context->PropLock); done: + WriteUnlock(&context->PropLock); ALCcontext_DecRef(context); } |