aboutsummaryrefslogtreecommitdiffstats
path: root/OpenAL32/alAuxEffectSlot.c
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2011-06-16 09:14:41 -0700
committerChris Robinson <[email protected]>2011-06-16 09:14:41 -0700
commit7d73ac440552babe27395a7985ff3f693303c61b (patch)
tree9d93807ba62608a62686172d9da58fc8d56de560 /OpenAL32/alAuxEffectSlot.c
parentc429a5be25978b2c0228af5cc448308110e7154c (diff)
Avoid calling some AL functions from under the context lock
There are still some more occurances to clear out (deletion in gen error, effects, some filters), which shall be coming up. There is a possibility for a deadlock between the listlock and the global/context lock, if another attempt to get the listlock is made while under the context lock.
Diffstat (limited to 'OpenAL32/alAuxEffectSlot.c')
-rw-r--r--OpenAL32/alAuxEffectSlot.c48
1 files changed, 30 insertions, 18 deletions
diff --git a/OpenAL32/alAuxEffectSlot.c b/OpenAL32/alAuxEffectSlot.c
index 9d25ce23..6fba29ee 100644
--- a/OpenAL32/alAuxEffectSlot.c
+++ b/OpenAL32/alAuxEffectSlot.c
@@ -244,6 +244,14 @@ AL_API ALvoid AL_APIENTRY alAuxiliaryEffectSlotiv(ALuint effectslot, ALenum para
{
ALCcontext *Context;
+ switch(param)
+ {
+ case AL_EFFECTSLOT_EFFECT:
+ case AL_EFFECTSLOT_AUXILIARY_SEND_AUTO:
+ alAuxiliaryEffectSloti(effectslot, param, piValues[0]);
+ return;
+ }
+
Context = GetContextSuspended();
if(!Context) return;
@@ -251,11 +259,6 @@ AL_API ALvoid AL_APIENTRY alAuxiliaryEffectSlotiv(ALuint effectslot, ALenum para
{
switch(param)
{
- case AL_EFFECTSLOT_EFFECT:
- case AL_EFFECTSLOT_AUXILIARY_SEND_AUTO:
- alAuxiliaryEffectSloti(effectslot, param, piValues[0]);
- break;
-
default:
alSetError(Context, AL_INVALID_ENUM);
break;
@@ -301,6 +304,13 @@ AL_API ALvoid AL_APIENTRY alAuxiliaryEffectSlotfv(ALuint effectslot, ALenum para
{
ALCcontext *Context;
+ switch(param)
+ {
+ case AL_EFFECTSLOT_GAIN:
+ alAuxiliaryEffectSlotf(effectslot, param, pflValues[0]);
+ return;
+ }
+
Context = GetContextSuspended();
if(!Context) return;
@@ -308,10 +318,6 @@ AL_API ALvoid AL_APIENTRY alAuxiliaryEffectSlotfv(ALuint effectslot, ALenum para
{
switch(param)
{
- case AL_EFFECTSLOT_GAIN:
- alAuxiliaryEffectSlotf(effectslot, param, pflValues[0]);
- break;
-
default:
alSetError(Context, AL_INVALID_ENUM);
break;
@@ -358,6 +364,14 @@ AL_API ALvoid AL_APIENTRY alGetAuxiliaryEffectSlotiv(ALuint effectslot, ALenum p
{
ALCcontext *Context;
+ switch(param)
+ {
+ case AL_EFFECTSLOT_EFFECT:
+ case AL_EFFECTSLOT_AUXILIARY_SEND_AUTO:
+ alGetAuxiliaryEffectSloti(effectslot, param, piValues);
+ return;
+ }
+
Context = GetContextSuspended();
if(!Context) return;
@@ -365,11 +379,6 @@ AL_API ALvoid AL_APIENTRY alGetAuxiliaryEffectSlotiv(ALuint effectslot, ALenum p
{
switch(param)
{
- case AL_EFFECTSLOT_EFFECT:
- case AL_EFFECTSLOT_AUXILIARY_SEND_AUTO:
- alGetAuxiliaryEffectSloti(effectslot, param, piValues);
- break;
-
default:
alSetError(Context, AL_INVALID_ENUM);
break;
@@ -412,6 +421,13 @@ AL_API ALvoid AL_APIENTRY alGetAuxiliaryEffectSlotfv(ALuint effectslot, ALenum p
{
ALCcontext *Context;
+ switch(param)
+ {
+ case AL_EFFECTSLOT_GAIN:
+ alGetAuxiliaryEffectSlotf(effectslot, param, pflValues);
+ return;
+ }
+
Context = GetContextSuspended();
if(!Context) return;
@@ -419,10 +435,6 @@ AL_API ALvoid AL_APIENTRY alGetAuxiliaryEffectSlotfv(ALuint effectslot, ALenum p
{
switch(param)
{
- case AL_EFFECTSLOT_GAIN:
- alGetAuxiliaryEffectSlotf(effectslot, param, pflValues);
- break;
-
default:
alSetError(Context, AL_INVALID_ENUM);
break;