diff options
author | Chris Robinson <[email protected]> | 2011-07-11 01:21:29 -0700 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2011-07-11 01:21:29 -0700 |
commit | 1299fa2801cea599236f76377036627a5364035c (patch) | |
tree | e5b09fa47bddbb990a207e6daab30be97a4671ce /OpenAL32 | |
parent | 52c78194b342dd401419374181fded95dcaa737d (diff) |
Avoid some alListenerfv calls while under the context lock
Diffstat (limited to 'OpenAL32')
-rw-r--r-- | OpenAL32/alListener.c | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/OpenAL32/alListener.c b/OpenAL32/alListener.c index 1042ebc7..834567ef 100644 --- a/OpenAL32/alListener.c +++ b/OpenAL32/alListener.c @@ -197,20 +197,14 @@ AL_API void AL_APIENTRY alListeneriv( ALenum eParam, const ALint* plValues ) ALCcontext *pContext; ALfloat flValues[6]; - pContext = GetLockedContext(); - if(!pContext) return; - if(plValues) { switch(eParam) { case AL_POSITION: case AL_VELOCITY: - flValues[0] = (ALfloat)plValues[0]; - flValues[1] = (ALfloat)plValues[1]; - flValues[2] = (ALfloat)plValues[2]; - alListenerfv(eParam, flValues); - break; + alListener3f(eParam, plValues[0], plValues[1], plValues[2]); + return; case AL_ORIENTATION: flValues[0] = (ALfloat)plValues[0]; @@ -220,8 +214,17 @@ AL_API void AL_APIENTRY alListeneriv( ALenum eParam, const ALint* plValues ) flValues[4] = (ALfloat)plValues[4]; flValues[5] = (ALfloat)plValues[5]; alListenerfv(eParam, flValues); - break; + return; + } + } + + pContext = GetLockedContext(); + if(!pContext) return; + if(plValues) + { + switch(eParam) + { default: alSetError(pContext, AL_INVALID_ENUM); break; |