From 7d73ac440552babe27395a7985ff3f693303c61b Mon Sep 17 00:00:00 2001 From: Chris Robinson Date: Thu, 16 Jun 2011 09:14:41 -0700 Subject: 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. --- OpenAL32/alFilter.c | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) (limited to 'OpenAL32/alFilter.c') diff --git a/OpenAL32/alFilter.c b/OpenAL32/alFilter.c index b16dc073..c740e4ff 100644 --- a/OpenAL32/alFilter.c +++ b/OpenAL32/alFilter.c @@ -187,6 +187,13 @@ AL_API ALvoid AL_APIENTRY alFilteriv(ALuint filter, ALenum param, ALint *piValue ALCcontext *Context; ALCdevice *Device; + switch(param) + { + case AL_FILTER_TYPE: + alFilteri(filter, param, piValues[0]); + return; + } + Context = GetContextSuspended(); if(!Context) return; @@ -195,10 +202,6 @@ AL_API ALvoid AL_APIENTRY alFilteriv(ALuint filter, ALenum param, ALint *piValue { switch(param) { - case AL_FILTER_TYPE: - alFilteri(filter, param, piValues[0]); - break; - default: alSetError(Context, AL_INVALID_ENUM); break; @@ -316,6 +319,13 @@ AL_API ALvoid AL_APIENTRY alGetFilteriv(ALuint filter, ALenum param, ALint *piVa ALCcontext *Context; ALCdevice *Device; + switch(param) + { + case AL_FILTER_TYPE: + alGetFilteri(filter, param, piValues); + return; + } + Context = GetContextSuspended(); if(!Context) return; @@ -324,10 +334,6 @@ AL_API ALvoid AL_APIENTRY alGetFilteriv(ALuint filter, ALenum param, ALint *piVa { switch(param) { - case AL_FILTER_TYPE: - alGetFilteri(filter, param, piValues); - break; - default: alSetError(Context, AL_INVALID_ENUM); break; -- cgit v1.2.3