Rename Suspend/ProcessContext since they are locking a mutex

This commit is contained in:
Chris Robinson 2011-06-30 18:10:04 -07:00
parent 032d0836a7
commit 723755788d
13 changed files with 246 additions and 248 deletions

View File

@ -1317,10 +1317,10 @@ static ALCboolean UpdateDeviceParams(ALCdevice *device, const ALCint *attrList)
if((device->Flags&DEVICE_RUNNING))
return ALC_TRUE;
SuspendContext(NULL);
LockContext(NULL);
if(ALCdevice_ResetPlayback(device) == ALC_FALSE)
{
ProcessContext(NULL);
UnlockContext(NULL);
return ALC_FALSE;
}
device->Flags |= DEVICE_RUNNING;
@ -1384,7 +1384,7 @@ static ALCboolean UpdateDeviceParams(ALCdevice *device, const ALCint *attrList)
if(ALEffect_DeviceUpdate(slot->EffectState, device) == AL_FALSE)
{
ProcessContext(NULL);
UnlockContext(NULL);
ALCdevice_StopPlayback(device);
device->Flags &= ~DEVICE_RUNNING;
return ALC_FALSE;
@ -1409,18 +1409,18 @@ static ALCboolean UpdateDeviceParams(ALCdevice *device, const ALCint *attrList)
source->NeedsUpdate = AL_FALSE;
}
}
ProcessContext(NULL);
UnlockContext(NULL);
return ALC_TRUE;
}
/*
SuspendContext
LockContext
Thread-safe entry
*/
ALCvoid SuspendContext(ALCcontext *pContext)
ALCvoid LockContext(ALCcontext *pContext)
{
(void)pContext;
EnterCriticalSection(&g_csMutex);
@ -1428,11 +1428,11 @@ ALCvoid SuspendContext(ALCcontext *pContext)
/*
ProcessContext
UnlockContext
Thread-safe exit
*/
ALCvoid ProcessContext(ALCcontext *pContext)
ALCvoid UnlockContext(ALCcontext *pContext)
{
(void)pContext;
LeaveCriticalSection(&g_csMutex);
@ -1440,11 +1440,11 @@ ALCvoid ProcessContext(ALCcontext *pContext)
/*
GetContextSuspended
GetLockedContext
Returns the currently active Context, in a locked state
*/
ALCcontext *GetContextSuspended(void)
ALCcontext *GetLockedContext(void)
{
ALCcontext *pContext = NULL;
@ -1459,7 +1459,7 @@ ALCcontext *GetContextSuspended(void)
if(!pContext)
pContext = GlobalContext;
if(pContext)
SuspendContext(pContext);
LockContext(pContext);
UnlockLists();
@ -2123,7 +2123,7 @@ ALC_API ALCcontext* ALC_APIENTRY alcCreateContext(ALCdevice *device, const ALCin
return NULL;
}
SuspendContext(NULL);
LockContext(NULL);
ALContext = NULL;
temp = realloc(device->Contexts, (device->NumContexts+1) * sizeof(*device->Contexts));
if(temp)
@ -2142,7 +2142,7 @@ ALC_API ALCcontext* ALC_APIENTRY alcCreateContext(ALCdevice *device, const ALCin
{
free(ALContext);
alcSetError(device, ALC_OUT_OF_MEMORY);
ProcessContext(NULL);
UnlockContext(NULL);
if(device->NumContexts == 0)
{
ALCdevice_StopPlayback(device);
@ -2156,7 +2156,7 @@ ALC_API ALCcontext* ALC_APIENTRY alcCreateContext(ALCdevice *device, const ALCin
ALContext->Device = device;
InitContext(ALContext);
ProcessContext(NULL);
UnlockContext(NULL);
ALContext->next = g_pContextList;
g_pContextList = ALContext;
@ -2200,7 +2200,7 @@ ALC_API ALCvoid ALC_APIENTRY alcDestroyContext(ALCcontext *context)
GlobalContext = NULL;
Device = context->Device;
SuspendContext(NULL);
LockContext(NULL);
for(i = 0;i < Device->NumContexts;i++)
{
if(Device->Contexts[i] == context)
@ -2210,7 +2210,7 @@ ALC_API ALCvoid ALC_APIENTRY alcDestroyContext(ALCcontext *context)
break;
}
}
ProcessContext(NULL);
UnlockContext(NULL);
if(Device->NumContexts == 0)
{

View File

@ -972,7 +972,7 @@ ALvoid aluMixData(ALCdevice *device, ALvoid *buffer, ALsizei size)
/* Clear mixing buffer */
memset(device->DryBuffer, 0, SamplesToDo*MAXCHANNELS*sizeof(ALfloat));
SuspendContext(NULL);
LockContext(NULL);
ctx = device->Contexts;
ctx_end = ctx + device->NumContexts;
while(ctx != ctx_end)
@ -1024,7 +1024,7 @@ ALvoid aluMixData(ALCdevice *device, ALvoid *buffer, ALsizei size)
ctx++;
}
ProcessContext(NULL);
UnlockContext(NULL);
//Post processing loop
for(i = 0;i < SamplesToDo;i++)
@ -1075,7 +1075,7 @@ ALvoid aluHandleDisconnect(ALCdevice *device)
{
ALuint i;
SuspendContext(NULL);
LockContext(NULL);
for(i = 0;i < device->NumContexts;i++)
{
ALCcontext *Context = device->Contexts[i];
@ -1096,5 +1096,5 @@ ALvoid aluHandleDisconnect(ALCdevice *device)
}
device->Connected = ALC_FALSE;
ProcessContext(NULL);
UnlockContext(NULL);
}

View File

@ -361,7 +361,7 @@ static void stream_buffer_attr_callback(pa_stream *stream, void *pdata) //{{{
ALCdevice *Device = pdata;
pulse_data *data = Device->ExtraData;
SuspendContext(NULL);
LockContext(NULL);
data->attr = *(pa_stream_get_buffer_attr(stream));
Device->UpdateSize = data->attr.minreq / data->frame_size;
@ -372,7 +372,7 @@ static void stream_buffer_attr_callback(pa_stream *stream, void *pdata) //{{{
AL_PRINT("PulseAudio returned minreq > tlength/2; expect break up\n");
}
ProcessContext(NULL);
UnlockContext(NULL);
}//}}}
static void stream_device_callback(pa_stream *stream, void *pdata) //{{{

View File

@ -469,13 +469,13 @@ void AppendCaptureDeviceList(const ALCchar *name);
ALCvoid alcSetError(ALCdevice *device, ALenum errorCode);
ALCvoid SuspendContext(ALCcontext *context);
ALCvoid ProcessContext(ALCcontext *context);
ALCvoid LockContext(ALCcontext *context);
ALCvoid UnlockContext(ALCcontext *context);
ALvoid *StartThread(ALuint (*func)(ALvoid*), ALvoid *ptr);
ALuint StopThread(ALvoid *thread);
ALCcontext *GetContextSuspended(void);
ALCcontext *GetLockedContext(void);
typedef struct RingBuffer RingBuffer;
RingBuffer *CreateRingBuffer(ALsizei frame_size, ALsizei length);

View File

@ -42,7 +42,7 @@ AL_API ALvoid AL_APIENTRY alGenAuxiliaryEffectSlots(ALsizei n, ALuint *effectslo
ALCcontext *Context;
ALCdevice *Device;
Context = GetContextSuspended();
Context = GetLockedContext();
if(!Context) return;
Device = Context->Device;
@ -97,7 +97,7 @@ AL_API ALvoid AL_APIENTRY alGenAuxiliaryEffectSlots(ALsizei n, ALuint *effectslo
}
}
ProcessContext(Context);
UnlockContext(Context);
}
AL_API ALvoid AL_APIENTRY alDeleteAuxiliaryEffectSlots(ALsizei n, ALuint *effectslots)
@ -107,7 +107,7 @@ AL_API ALvoid AL_APIENTRY alDeleteAuxiliaryEffectSlots(ALsizei n, ALuint *effect
ALboolean SlotsValid = AL_FALSE;
ALsizei i;
Context = GetContextSuspended();
Context = GetLockedContext();
if(!Context) return;
if(n < 0)
@ -152,7 +152,7 @@ AL_API ALvoid AL_APIENTRY alDeleteAuxiliaryEffectSlots(ALsizei n, ALuint *effect
}
}
ProcessContext(Context);
UnlockContext(Context);
}
AL_API ALboolean AL_APIENTRY alIsAuxiliaryEffectSlot(ALuint effectslot)
@ -160,13 +160,13 @@ AL_API ALboolean AL_APIENTRY alIsAuxiliaryEffectSlot(ALuint effectslot)
ALCcontext *Context;
ALboolean result;
Context = GetContextSuspended();
Context = GetLockedContext();
if(!Context) return AL_FALSE;
result = (LookupEffectSlot(Context->EffectSlotMap, effectslot) ?
AL_TRUE : AL_FALSE);
ProcessContext(Context);
UnlockContext(Context);
return result;
}
@ -178,7 +178,7 @@ AL_API ALvoid AL_APIENTRY alAuxiliaryEffectSloti(ALuint effectslot, ALenum param
ALboolean updateSources = AL_FALSE;
ALeffectslot *EffectSlot;
Context = GetContextSuspended();
Context = GetLockedContext();
if(!Context) return;
Device = Context->Device;
@ -237,7 +237,7 @@ AL_API ALvoid AL_APIENTRY alAuxiliaryEffectSloti(ALuint effectslot, ALenum param
}
}
ProcessContext(Context);
UnlockContext(Context);
}
AL_API ALvoid AL_APIENTRY alAuxiliaryEffectSlotiv(ALuint effectslot, ALenum param, ALint *piValues)
@ -252,7 +252,7 @@ AL_API ALvoid AL_APIENTRY alAuxiliaryEffectSlotiv(ALuint effectslot, ALenum para
return;
}
Context = GetContextSuspended();
Context = GetLockedContext();
if(!Context) return;
if(LookupEffectSlot(Context->EffectSlotMap, effectslot) != NULL)
@ -267,7 +267,7 @@ AL_API ALvoid AL_APIENTRY alAuxiliaryEffectSlotiv(ALuint effectslot, ALenum para
else
alSetError(Context, AL_INVALID_NAME);
ProcessContext(Context);
UnlockContext(Context);
}
AL_API ALvoid AL_APIENTRY alAuxiliaryEffectSlotf(ALuint effectslot, ALenum param, ALfloat flValue)
@ -275,7 +275,7 @@ AL_API ALvoid AL_APIENTRY alAuxiliaryEffectSlotf(ALuint effectslot, ALenum param
ALCcontext *Context;
ALeffectslot *EffectSlot;
Context = GetContextSuspended();
Context = GetLockedContext();
if(!Context) return;
if((EffectSlot=LookupEffectSlot(Context->EffectSlotMap, effectslot)) != NULL)
@ -297,7 +297,7 @@ AL_API ALvoid AL_APIENTRY alAuxiliaryEffectSlotf(ALuint effectslot, ALenum param
else
alSetError(Context, AL_INVALID_NAME);
ProcessContext(Context);
UnlockContext(Context);
}
AL_API ALvoid AL_APIENTRY alAuxiliaryEffectSlotfv(ALuint effectslot, ALenum param, ALfloat *pflValues)
@ -311,7 +311,7 @@ AL_API ALvoid AL_APIENTRY alAuxiliaryEffectSlotfv(ALuint effectslot, ALenum para
return;
}
Context = GetContextSuspended();
Context = GetLockedContext();
if(!Context) return;
if(LookupEffectSlot(Context->EffectSlotMap, effectslot) != NULL)
@ -326,7 +326,7 @@ AL_API ALvoid AL_APIENTRY alAuxiliaryEffectSlotfv(ALuint effectslot, ALenum para
else
alSetError(Context, AL_INVALID_NAME);
ProcessContext(Context);
UnlockContext(Context);
}
AL_API ALvoid AL_APIENTRY alGetAuxiliaryEffectSloti(ALuint effectslot, ALenum param, ALint *piValue)
@ -334,7 +334,7 @@ AL_API ALvoid AL_APIENTRY alGetAuxiliaryEffectSloti(ALuint effectslot, ALenum pa
ALCcontext *Context;
ALeffectslot *EffectSlot;
Context = GetContextSuspended();
Context = GetLockedContext();
if(!Context) return;
if((EffectSlot=LookupEffectSlot(Context->EffectSlotMap, effectslot)) != NULL)
@ -357,7 +357,7 @@ AL_API ALvoid AL_APIENTRY alGetAuxiliaryEffectSloti(ALuint effectslot, ALenum pa
else
alSetError(Context, AL_INVALID_NAME);
ProcessContext(Context);
UnlockContext(Context);
}
AL_API ALvoid AL_APIENTRY alGetAuxiliaryEffectSlotiv(ALuint effectslot, ALenum param, ALint *piValues)
@ -372,7 +372,7 @@ AL_API ALvoid AL_APIENTRY alGetAuxiliaryEffectSlotiv(ALuint effectslot, ALenum p
return;
}
Context = GetContextSuspended();
Context = GetLockedContext();
if(!Context) return;
if(LookupEffectSlot(Context->EffectSlotMap, effectslot) != NULL)
@ -387,7 +387,7 @@ AL_API ALvoid AL_APIENTRY alGetAuxiliaryEffectSlotiv(ALuint effectslot, ALenum p
else
alSetError(Context, AL_INVALID_NAME);
ProcessContext(Context);
UnlockContext(Context);
}
AL_API ALvoid AL_APIENTRY alGetAuxiliaryEffectSlotf(ALuint effectslot, ALenum param, ALfloat *pflValue)
@ -395,7 +395,7 @@ AL_API ALvoid AL_APIENTRY alGetAuxiliaryEffectSlotf(ALuint effectslot, ALenum pa
ALCcontext *Context;
ALeffectslot *EffectSlot;
Context = GetContextSuspended();
Context = GetLockedContext();
if(!Context) return;
if((EffectSlot=LookupEffectSlot(Context->EffectSlotMap, effectslot)) != NULL)
@ -414,7 +414,7 @@ AL_API ALvoid AL_APIENTRY alGetAuxiliaryEffectSlotf(ALuint effectslot, ALenum pa
else
alSetError(Context, AL_INVALID_NAME);
ProcessContext(Context);
UnlockContext(Context);
}
AL_API ALvoid AL_APIENTRY alGetAuxiliaryEffectSlotfv(ALuint effectslot, ALenum param, ALfloat *pflValues)
@ -428,7 +428,7 @@ AL_API ALvoid AL_APIENTRY alGetAuxiliaryEffectSlotfv(ALuint effectslot, ALenum p
return;
}
Context = GetContextSuspended();
Context = GetLockedContext();
if(!Context) return;
if(LookupEffectSlot(Context->EffectSlotMap, effectslot) != NULL)
@ -443,7 +443,7 @@ AL_API ALvoid AL_APIENTRY alGetAuxiliaryEffectSlotfv(ALuint effectslot, ALenum p
else
alSetError(Context, AL_INVALID_NAME);
ProcessContext(Context);
UnlockContext(Context);
}

View File

@ -139,7 +139,7 @@ AL_API ALvoid AL_APIENTRY alGenBuffers(ALsizei n, ALuint *buffers)
ALCcontext *Context;
ALsizei i=0;
Context = GetContextSuspended();
Context = GetLockedContext();
if(!Context) return;
/* Check that we are actually generating some Buffers */
@ -178,7 +178,7 @@ AL_API ALvoid AL_APIENTRY alGenBuffers(ALsizei n, ALuint *buffers)
}
}
ProcessContext(Context);
UnlockContext(Context);
}
/*
@ -194,7 +194,7 @@ AL_API ALvoid AL_APIENTRY alDeleteBuffers(ALsizei n, const ALuint *buffers)
ALbuffer *ALBuf;
ALsizei i;
Context = GetContextSuspended();
Context = GetLockedContext();
if(!Context) return;
Failed = AL_TRUE;
@ -250,7 +250,7 @@ AL_API ALvoid AL_APIENTRY alDeleteBuffers(ALsizei n, const ALuint *buffers)
}
}
ProcessContext(Context);
UnlockContext(Context);
}
/*
@ -263,13 +263,13 @@ AL_API ALboolean AL_APIENTRY alIsBuffer(ALuint buffer)
ALCcontext *Context;
ALboolean result;
Context = GetContextSuspended();
Context = GetLockedContext();
if(!Context) return AL_FALSE;
result = ((!buffer || LookupBuffer(Context->Device->BufferMap, buffer)) ?
AL_TRUE : AL_FALSE);
ProcessContext(Context);
UnlockContext(Context);
return result;
}
@ -289,7 +289,7 @@ AL_API ALvoid AL_APIENTRY alBufferData(ALuint buffer,ALenum format,const ALvoid
ALbuffer *ALBuf;
ALenum err;
Context = GetContextSuspended();
Context = GetLockedContext();
if(!Context) return;
device = Context->Device;
@ -374,7 +374,7 @@ AL_API ALvoid AL_APIENTRY alBufferData(ALuint buffer,ALenum format,const ALvoid
} break;
}
ProcessContext(Context);
UnlockContext(Context);
}
/*
@ -391,7 +391,7 @@ AL_API ALvoid AL_APIENTRY alBufferSubDataSOFT(ALuint buffer,ALenum format,const
ALCdevice *device;
ALbuffer *ALBuf;
Context = GetContextSuspended();
Context = GetLockedContext();
if(!Context) return;
device = Context->Device;
@ -432,7 +432,7 @@ AL_API ALvoid AL_APIENTRY alBufferSubDataSOFT(ALuint buffer,ALenum format,const
data, SrcType, Channels, length);
}
ProcessContext(Context);
UnlockContext(Context);
}
@ -445,7 +445,7 @@ AL_API void AL_APIENTRY alBufferSamplesSOFT(ALuint buffer,
ALbuffer *ALBuf;
ALenum err;
Context = GetContextSuspended();
Context = GetLockedContext();
if(!Context) return;
device = Context->Device;
@ -472,7 +472,7 @@ AL_API void AL_APIENTRY alBufferSamplesSOFT(ALuint buffer,
alSetError(Context, err);
}
ProcessContext(Context);
UnlockContext(Context);
}
AL_API void AL_APIENTRY alBufferSubSamplesSOFT(ALuint buffer,
@ -483,7 +483,7 @@ AL_API void AL_APIENTRY alBufferSubSamplesSOFT(ALuint buffer,
ALCdevice *device;
ALbuffer *ALBuf;
Context = GetContextSuspended();
Context = GetLockedContext();
if(!Context) return;
device = Context->Device;
@ -514,7 +514,7 @@ AL_API void AL_APIENTRY alBufferSubSamplesSOFT(ALuint buffer,
}
}
ProcessContext(Context);
UnlockContext(Context);
}
AL_API void AL_APIENTRY alGetBufferSamplesSOFT(ALuint buffer,
@ -525,7 +525,7 @@ AL_API void AL_APIENTRY alGetBufferSamplesSOFT(ALuint buffer,
ALCdevice *device;
ALbuffer *ALBuf;
Context = GetContextSuspended();
Context = GetLockedContext();
if(!Context) return;
device = Context->Device;
@ -556,7 +556,7 @@ AL_API void AL_APIENTRY alGetBufferSamplesSOFT(ALuint buffer,
}
}
ProcessContext(Context);
UnlockContext(Context);
}
AL_API ALboolean AL_APIENTRY alIsBufferFormatSupportedSOFT(ALenum format)
@ -566,12 +566,12 @@ AL_API ALboolean AL_APIENTRY alIsBufferFormatSupportedSOFT(ALenum format)
ALCcontext *Context;
ALboolean ret;
Context = GetContextSuspended();
Context = GetLockedContext();
if(!Context) return AL_FALSE;
ret = DecomposeFormat(format, &DstChannels, &DstType);
ProcessContext(Context);
UnlockContext(Context);
return ret;
}
@ -584,7 +584,7 @@ AL_API void AL_APIENTRY alBufferf(ALuint buffer, ALenum eParam, ALfloat flValue)
(void)flValue;
pContext = GetContextSuspended();
pContext = GetLockedContext();
if(!pContext) return;
device = pContext->Device;
@ -600,7 +600,7 @@ AL_API void AL_APIENTRY alBufferf(ALuint buffer, ALenum eParam, ALfloat flValue)
}
}
ProcessContext(pContext);
UnlockContext(pContext);
}
@ -613,7 +613,7 @@ AL_API void AL_APIENTRY alBuffer3f(ALuint buffer, ALenum eParam, ALfloat flValue
(void)flValue2;
(void)flValue3;
pContext = GetContextSuspended();
pContext = GetLockedContext();
if(!pContext) return;
device = pContext->Device;
@ -629,7 +629,7 @@ AL_API void AL_APIENTRY alBuffer3f(ALuint buffer, ALenum eParam, ALfloat flValue
}
}
ProcessContext(pContext);
UnlockContext(pContext);
}
@ -638,7 +638,7 @@ AL_API void AL_APIENTRY alBufferfv(ALuint buffer, ALenum eParam, const ALfloat*
ALCcontext *pContext;
ALCdevice *device;
pContext = GetContextSuspended();
pContext = GetLockedContext();
if(!pContext) return;
device = pContext->Device;
@ -656,7 +656,7 @@ AL_API void AL_APIENTRY alBufferfv(ALuint buffer, ALenum eParam, const ALfloat*
}
}
ProcessContext(pContext);
UnlockContext(pContext);
}
@ -667,7 +667,7 @@ AL_API void AL_APIENTRY alBufferi(ALuint buffer, ALenum eParam, ALint lValue)
(void)lValue;
pContext = GetContextSuspended();
pContext = GetLockedContext();
if(!pContext) return;
device = pContext->Device;
@ -683,7 +683,7 @@ AL_API void AL_APIENTRY alBufferi(ALuint buffer, ALenum eParam, ALint lValue)
}
}
ProcessContext(pContext);
UnlockContext(pContext);
}
@ -696,7 +696,7 @@ AL_API void AL_APIENTRY alBuffer3i( ALuint buffer, ALenum eParam, ALint lValue1,
(void)lValue2;
(void)lValue3;
pContext = GetContextSuspended();
pContext = GetLockedContext();
if(!pContext) return;
device = pContext->Device;
@ -712,7 +712,7 @@ AL_API void AL_APIENTRY alBuffer3i( ALuint buffer, ALenum eParam, ALint lValue1,
}
}
ProcessContext(pContext);
UnlockContext(pContext);
}
@ -722,7 +722,7 @@ AL_API void AL_APIENTRY alBufferiv(ALuint buffer, ALenum eParam, const ALint* pl
ALCdevice *device;
ALbuffer *ALBuf;
pContext = GetContextSuspended();
pContext = GetLockedContext();
if(!pContext) return;
device = pContext->Device;
@ -760,7 +760,7 @@ AL_API void AL_APIENTRY alBufferiv(ALuint buffer, ALenum eParam, const ALint* pl
}
}
ProcessContext(pContext);
UnlockContext(pContext);
}
@ -769,7 +769,7 @@ AL_API ALvoid AL_APIENTRY alGetBufferf(ALuint buffer, ALenum eParam, ALfloat *pf
ALCcontext *pContext;
ALCdevice *device;
pContext = GetContextSuspended();
pContext = GetLockedContext();
if(!pContext) return;
device = pContext->Device;
@ -787,7 +787,7 @@ AL_API ALvoid AL_APIENTRY alGetBufferf(ALuint buffer, ALenum eParam, ALfloat *pf
}
}
ProcessContext(pContext);
UnlockContext(pContext);
}
@ -796,7 +796,7 @@ AL_API void AL_APIENTRY alGetBuffer3f(ALuint buffer, ALenum eParam, ALfloat* pfl
ALCcontext *pContext;
ALCdevice *device;
pContext = GetContextSuspended();
pContext = GetLockedContext();
if(!pContext) return;
device = pContext->Device;
@ -814,7 +814,7 @@ AL_API void AL_APIENTRY alGetBuffer3f(ALuint buffer, ALenum eParam, ALfloat* pfl
}
}
ProcessContext(pContext);
UnlockContext(pContext);
}
@ -823,7 +823,7 @@ AL_API void AL_APIENTRY alGetBufferfv(ALuint buffer, ALenum eParam, ALfloat* pfl
ALCcontext *pContext;
ALCdevice *device;
pContext = GetContextSuspended();
pContext = GetLockedContext();
if(!pContext) return;
device = pContext->Device;
@ -841,7 +841,7 @@ AL_API void AL_APIENTRY alGetBufferfv(ALuint buffer, ALenum eParam, ALfloat* pfl
}
}
ProcessContext(pContext);
UnlockContext(pContext);
}
@ -851,7 +851,7 @@ AL_API ALvoid AL_APIENTRY alGetBufferi(ALuint buffer, ALenum eParam, ALint *plVa
ALbuffer *pBuffer;
ALCdevice *device;
pContext = GetContextSuspended();
pContext = GetLockedContext();
if(!pContext) return;
device = pContext->Device;
@ -885,7 +885,7 @@ AL_API ALvoid AL_APIENTRY alGetBufferi(ALuint buffer, ALenum eParam, ALint *plVa
}
}
ProcessContext(pContext);
UnlockContext(pContext);
}
@ -894,7 +894,7 @@ AL_API void AL_APIENTRY alGetBuffer3i(ALuint buffer, ALenum eParam, ALint* plVal
ALCcontext *pContext;
ALCdevice *device;
pContext = GetContextSuspended();
pContext = GetLockedContext();
if(!pContext) return;
device = pContext->Device;
@ -912,7 +912,7 @@ AL_API void AL_APIENTRY alGetBuffer3i(ALuint buffer, ALenum eParam, ALint* plVal
}
}
ProcessContext(pContext);
UnlockContext(pContext);
}
@ -932,7 +932,7 @@ AL_API void AL_APIENTRY alGetBufferiv(ALuint buffer, ALenum eParam, ALint* plVal
return;
}
pContext = GetContextSuspended();
pContext = GetLockedContext();
if(!pContext) return;
device = pContext->Device;
@ -955,7 +955,7 @@ AL_API void AL_APIENTRY alGetBufferiv(ALuint buffer, ALenum eParam, ALint* plVal
}
}
ProcessContext(pContext);
UnlockContext(pContext);
}

View File

@ -43,7 +43,7 @@ AL_API ALvoid AL_APIENTRY alGenEffects(ALsizei n, ALuint *effects)
ALCcontext *Context;
ALsizei i=0;
Context = GetContextSuspended();
Context = GetLockedContext();
if(!Context) return;
if(n < 0 || IsBadWritePtr((void*)effects, n * sizeof(ALuint)))
@ -82,7 +82,7 @@ AL_API ALvoid AL_APIENTRY alGenEffects(ALsizei n, ALuint *effects)
}
}
ProcessContext(Context);
UnlockContext(Context);
}
AL_API ALvoid AL_APIENTRY alDeleteEffects(ALsizei n, ALuint *effects)
@ -93,7 +93,7 @@ AL_API ALvoid AL_APIENTRY alDeleteEffects(ALsizei n, ALuint *effects)
ALboolean Failed;
ALsizei i;
Context = GetContextSuspended();
Context = GetLockedContext();
if(!Context) return;
Failed = AL_TRUE;
@ -135,7 +135,7 @@ AL_API ALvoid AL_APIENTRY alDeleteEffects(ALsizei n, ALuint *effects)
}
}
ProcessContext(Context);
UnlockContext(Context);
}
AL_API ALboolean AL_APIENTRY alIsEffect(ALuint effect)
@ -143,13 +143,13 @@ AL_API ALboolean AL_APIENTRY alIsEffect(ALuint effect)
ALCcontext *Context;
ALboolean result;
Context = GetContextSuspended();
Context = GetLockedContext();
if(!Context) return AL_FALSE;
result = ((!effect || LookupEffect(Context->Device->EffectMap, effect)) ?
AL_TRUE : AL_FALSE);
ProcessContext(Context);
UnlockContext(Context);
return result;
}
@ -160,7 +160,7 @@ AL_API ALvoid AL_APIENTRY alEffecti(ALuint effect, ALenum param, ALint iValue)
ALCdevice *Device;
ALeffect *ALEffect;
Context = GetContextSuspended();
Context = GetLockedContext();
if(!Context) return;
Device = Context->Device;
@ -264,7 +264,7 @@ AL_API ALvoid AL_APIENTRY alEffecti(ALuint effect, ALenum param, ALint iValue)
else
alSetError(Context, AL_INVALID_NAME);
ProcessContext(Context);
UnlockContext(Context);
}
AL_API ALvoid AL_APIENTRY alEffectiv(ALuint effect, ALenum param, ALint *piValues)
@ -279,7 +279,7 @@ AL_API ALvoid AL_APIENTRY alEffectf(ALuint effect, ALenum param, ALfloat flValue
ALCdevice *Device;
ALeffect *ALEffect;
Context = GetContextSuspended();
Context = GetLockedContext();
if(!Context) return;
Device = Context->Device;
@ -650,7 +650,7 @@ AL_API ALvoid AL_APIENTRY alEffectf(ALuint effect, ALenum param, ALfloat flValue
else
alSetError(Context, AL_INVALID_NAME);
ProcessContext(Context);
UnlockContext(Context);
}
AL_API ALvoid AL_APIENTRY alEffectfv(ALuint effect, ALenum param, ALfloat *pflValues)
@ -659,7 +659,7 @@ AL_API ALvoid AL_APIENTRY alEffectfv(ALuint effect, ALenum param, ALfloat *pflVa
ALCdevice *Device;
ALeffect *ALEffect;
Context = GetContextSuspended();
Context = GetLockedContext();
if(!Context) return;
Device = Context->Device;
@ -804,7 +804,7 @@ AL_API ALvoid AL_APIENTRY alEffectfv(ALuint effect, ALenum param, ALfloat *pflVa
else
alSetError(Context, AL_INVALID_NAME);
ProcessContext(Context);
UnlockContext(Context);
}
AL_API ALvoid AL_APIENTRY alGetEffecti(ALuint effect, ALenum param, ALint *piValue)
@ -813,7 +813,7 @@ AL_API ALvoid AL_APIENTRY alGetEffecti(ALuint effect, ALenum param, ALint *piVal
ALCdevice *Device;
ALeffect *ALEffect;
Context = GetContextSuspended();
Context = GetLockedContext();
if(!Context) return;
Device = Context->Device;
@ -883,7 +883,7 @@ AL_API ALvoid AL_APIENTRY alGetEffecti(ALuint effect, ALenum param, ALint *piVal
else
alSetError(Context, AL_INVALID_NAME);
ProcessContext(Context);
UnlockContext(Context);
}
AL_API ALvoid AL_APIENTRY alGetEffectiv(ALuint effect, ALenum param, ALint *piValues)
@ -898,7 +898,7 @@ AL_API ALvoid AL_APIENTRY alGetEffectf(ALuint effect, ALenum param, ALfloat *pfl
ALCdevice *Device;
ALeffect *ALEffect;
Context = GetContextSuspended();
Context = GetLockedContext();
if(!Context) return;
Device = Context->Device;
@ -1115,7 +1115,7 @@ AL_API ALvoid AL_APIENTRY alGetEffectf(ALuint effect, ALenum param, ALfloat *pfl
else
alSetError(Context, AL_INVALID_NAME);
ProcessContext(Context);
UnlockContext(Context);
}
AL_API ALvoid AL_APIENTRY alGetEffectfv(ALuint effect, ALenum param, ALfloat *pflValues)
@ -1124,7 +1124,7 @@ AL_API ALvoid AL_APIENTRY alGetEffectfv(ALuint effect, ALenum param, ALfloat *pf
ALCdevice *Device;
ALeffect *ALEffect;
Context = GetContextSuspended();
Context = GetLockedContext();
if(!Context) return;
Device = Context->Device;
@ -1248,7 +1248,7 @@ AL_API ALvoid AL_APIENTRY alGetEffectfv(ALuint effect, ALenum param, ALfloat *pf
else
alSetError(Context, AL_INVALID_NAME);
ProcessContext(Context);
UnlockContext(Context);
}

View File

@ -29,13 +29,13 @@ AL_API ALenum AL_APIENTRY alGetError(ALvoid)
ALCcontext *Context;
ALenum errorCode;
Context = GetContextSuspended();
Context = GetLockedContext();
if(!Context) return AL_INVALID_OPERATION;
errorCode = Context->LastError;
Context->LastError = AL_NO_ERROR;
ProcessContext(Context);
UnlockContext(Context);
return errorCode;
}

View File

@ -335,22 +335,19 @@ const struct EffectList EffectList[] = {
AL_API ALboolean AL_APIENTRY alIsExtensionPresent(const ALchar *extName)
{
ALboolean bIsSupported = AL_FALSE;
ALCcontext *pContext;
ALCcontext *Context;
const char *ptr;
size_t len;
pContext = GetContextSuspended();
if(!pContext) return AL_FALSE;
Context = GetLockedContext();
if(!Context) return AL_FALSE;
if(!extName)
alSetError(Context, AL_INVALID_VALUE);
else
{
alSetError(pContext, AL_INVALID_VALUE);
ProcessContext(pContext);
return AL_FALSE;
}
len = strlen(extName);
ptr = pContext->ExtensionList;
ptr = Context->ExtensionList;
while(ptr && *ptr)
{
if(strncasecmp(ptr, extName, len) == 0 &&
@ -366,8 +363,9 @@ AL_API ALboolean AL_APIENTRY alIsExtensionPresent(const ALchar *extName)
} while(isspace(*ptr));
}
}
}
ProcessContext(pContext);
UnlockContext(Context);
return bIsSupported;
}

View File

@ -39,7 +39,7 @@ AL_API ALvoid AL_APIENTRY alGenFilters(ALsizei n, ALuint *filters)
ALCcontext *Context;
ALsizei i=0;
Context = GetContextSuspended();
Context = GetLockedContext();
if(!Context) return;
if(n < 0 || IsBadWritePtr((void*)filters, n * sizeof(ALuint)))
@ -78,7 +78,7 @@ AL_API ALvoid AL_APIENTRY alGenFilters(ALsizei n, ALuint *filters)
}
}
ProcessContext(Context);
UnlockContext(Context);
}
AL_API ALvoid AL_APIENTRY alDeleteFilters(ALsizei n, ALuint *filters)
@ -89,7 +89,7 @@ AL_API ALvoid AL_APIENTRY alDeleteFilters(ALsizei n, ALuint *filters)
ALboolean Failed;
ALsizei i;
Context = GetContextSuspended();
Context = GetLockedContext();
if(!Context) return;
Failed = AL_TRUE;
@ -131,7 +131,7 @@ AL_API ALvoid AL_APIENTRY alDeleteFilters(ALsizei n, ALuint *filters)
}
}
ProcessContext(Context);
UnlockContext(Context);
}
AL_API ALboolean AL_APIENTRY alIsFilter(ALuint filter)
@ -139,13 +139,13 @@ AL_API ALboolean AL_APIENTRY alIsFilter(ALuint filter)
ALCcontext *Context;
ALboolean result;
Context = GetContextSuspended();
Context = GetLockedContext();
if(!Context) return AL_FALSE;
result = ((!filter || LookupFilter(Context->Device->FilterMap, filter)) ?
AL_TRUE : AL_FALSE);
ProcessContext(Context);
UnlockContext(Context);
return result;
}
@ -156,7 +156,7 @@ AL_API ALvoid AL_APIENTRY alFilteri(ALuint filter, ALenum param, ALint iValue)
ALCdevice *Device;
ALfilter *ALFilter;
Context = GetContextSuspended();
Context = GetLockedContext();
if(!Context) return;
Device = Context->Device;
@ -180,7 +180,7 @@ AL_API ALvoid AL_APIENTRY alFilteri(ALuint filter, ALenum param, ALint iValue)
else
alSetError(Context, AL_INVALID_NAME);
ProcessContext(Context);
UnlockContext(Context);
}
AL_API ALvoid AL_APIENTRY alFilteriv(ALuint filter, ALenum param, ALint *piValues)
@ -195,7 +195,7 @@ AL_API ALvoid AL_APIENTRY alFilteriv(ALuint filter, ALenum param, ALint *piValue
return;
}
Context = GetContextSuspended();
Context = GetLockedContext();
if(!Context) return;
Device = Context->Device;
@ -211,7 +211,7 @@ AL_API ALvoid AL_APIENTRY alFilteriv(ALuint filter, ALenum param, ALint *piValue
else
alSetError(Context, AL_INVALID_NAME);
ProcessContext(Context);
UnlockContext(Context);
}
AL_API ALvoid AL_APIENTRY alFilterf(ALuint filter, ALenum param, ALfloat flValue)
@ -220,7 +220,7 @@ AL_API ALvoid AL_APIENTRY alFilterf(ALuint filter, ALenum param, ALfloat flValue
ALCdevice *Device;
ALfilter *ALFilter;
Context = GetContextSuspended();
Context = GetLockedContext();
if(!Context) return;
Device = Context->Device;
@ -261,7 +261,7 @@ AL_API ALvoid AL_APIENTRY alFilterf(ALuint filter, ALenum param, ALfloat flValue
else
alSetError(Context, AL_INVALID_NAME);
ProcessContext(Context);
UnlockContext(Context);
}
AL_API ALvoid AL_APIENTRY alFilterfv(ALuint filter, ALenum param, ALfloat *pflValues)
@ -276,7 +276,7 @@ AL_API ALvoid AL_APIENTRY alGetFilteri(ALuint filter, ALenum param, ALint *piVal
ALCdevice *Device;
ALfilter *ALFilter;
Context = GetContextSuspended();
Context = GetLockedContext();
if(!Context) return;
Device = Context->Device;
@ -296,7 +296,7 @@ AL_API ALvoid AL_APIENTRY alGetFilteri(ALuint filter, ALenum param, ALint *piVal
else
alSetError(Context, AL_INVALID_NAME);
ProcessContext(Context);
UnlockContext(Context);
}
AL_API ALvoid AL_APIENTRY alGetFilteriv(ALuint filter, ALenum param, ALint *piValues)
@ -311,7 +311,7 @@ AL_API ALvoid AL_APIENTRY alGetFilteriv(ALuint filter, ALenum param, ALint *piVa
return;
}
Context = GetContextSuspended();
Context = GetLockedContext();
if(!Context) return;
Device = Context->Device;
@ -327,7 +327,7 @@ AL_API ALvoid AL_APIENTRY alGetFilteriv(ALuint filter, ALenum param, ALint *piVa
else
alSetError(Context, AL_INVALID_NAME);
ProcessContext(Context);
UnlockContext(Context);
}
AL_API ALvoid AL_APIENTRY alGetFilterf(ALuint filter, ALenum param, ALfloat *pflValue)
@ -336,7 +336,7 @@ AL_API ALvoid AL_APIENTRY alGetFilterf(ALuint filter, ALenum param, ALfloat *pfl
ALCdevice *Device;
ALfilter *ALFilter;
Context = GetContextSuspended();
Context = GetLockedContext();
if(!Context) return;
Device = Context->Device;
@ -369,7 +369,7 @@ AL_API ALvoid AL_APIENTRY alGetFilterf(ALuint filter, ALenum param, ALfloat *pfl
else
alSetError(Context, AL_INVALID_NAME);
ProcessContext(Context);
UnlockContext(Context);
}
AL_API ALvoid AL_APIENTRY alGetFilterfv(ALuint filter, ALenum param, ALfloat *pflValues)

View File

@ -31,7 +31,7 @@ AL_API ALvoid AL_APIENTRY alListenerf(ALenum eParam, ALfloat flValue)
ALCcontext *pContext;
ALboolean updateAll = AL_FALSE;
pContext = GetContextSuspended();
pContext = GetLockedContext();
if(!pContext) return;
switch(eParam)
@ -73,7 +73,7 @@ AL_API ALvoid AL_APIENTRY alListenerf(ALenum eParam, ALfloat flValue)
}
}
ProcessContext(pContext);
UnlockContext(pContext);
}
@ -82,7 +82,7 @@ AL_API ALvoid AL_APIENTRY alListener3f(ALenum eParam, ALfloat flValue1, ALfloat
ALCcontext *pContext;
ALboolean updateWorld = AL_FALSE;
pContext = GetContextSuspended();
pContext = GetLockedContext();
if(!pContext) return;
switch(eParam)
@ -117,7 +117,7 @@ AL_API ALvoid AL_APIENTRY alListener3f(ALenum eParam, ALfloat flValue1, ALfloat
}
}
ProcessContext(pContext);
UnlockContext(pContext);
}
@ -142,7 +142,7 @@ AL_API ALvoid AL_APIENTRY alListenerfv(ALenum eParam, const ALfloat *pflValues)
}
}
pContext = GetContextSuspended();
pContext = GetLockedContext();
if(!pContext) return;
if(pflValues)
@ -179,7 +179,7 @@ AL_API ALvoid AL_APIENTRY alListenerfv(ALenum eParam, const ALfloat *pflValues)
}
}
ProcessContext(pContext);
UnlockContext(pContext);
}
@ -189,7 +189,7 @@ AL_API ALvoid AL_APIENTRY alListeneri(ALenum eParam, ALint lValue)
(void)lValue;
pContext = GetContextSuspended();
pContext = GetLockedContext();
if(!pContext) return;
switch(eParam)
@ -199,7 +199,7 @@ AL_API ALvoid AL_APIENTRY alListeneri(ALenum eParam, ALint lValue)
break;
}
ProcessContext(pContext);
UnlockContext(pContext);
}
@ -215,7 +215,7 @@ AL_API void AL_APIENTRY alListener3i(ALenum eParam, ALint lValue1, ALint lValue2
return;
}
pContext = GetContextSuspended();
pContext = GetLockedContext();
if(!pContext) return;
switch(eParam)
@ -225,7 +225,7 @@ AL_API void AL_APIENTRY alListener3i(ALenum eParam, ALint lValue1, ALint lValue2
break;
}
ProcessContext(pContext);
UnlockContext(pContext);
}
@ -234,7 +234,7 @@ AL_API void AL_APIENTRY alListeneriv( ALenum eParam, const ALint* plValues )
ALCcontext *pContext;
ALfloat flValues[6];
pContext = GetContextSuspended();
pContext = GetLockedContext();
if(!pContext) return;
if(plValues)
@ -267,7 +267,7 @@ AL_API void AL_APIENTRY alListeneriv( ALenum eParam, const ALint* plValues )
else
alSetError(pContext, AL_INVALID_VALUE);
ProcessContext(pContext);
UnlockContext(pContext);
}
@ -275,7 +275,7 @@ AL_API ALvoid AL_APIENTRY alGetListenerf(ALenum eParam, ALfloat *pflValue)
{
ALCcontext *pContext;
pContext = GetContextSuspended();
pContext = GetLockedContext();
if(!pContext) return;
if(pflValue)
@ -298,7 +298,7 @@ AL_API ALvoid AL_APIENTRY alGetListenerf(ALenum eParam, ALfloat *pflValue)
else
alSetError(pContext, AL_INVALID_VALUE);
ProcessContext(pContext);
UnlockContext(pContext);
}
@ -306,7 +306,7 @@ AL_API ALvoid AL_APIENTRY alGetListener3f(ALenum eParam, ALfloat *pflValue1, ALf
{
ALCcontext *pContext;
pContext = GetContextSuspended();
pContext = GetLockedContext();
if(!pContext) return;
if(pflValue1 && pflValue2 && pflValue3)
@ -333,7 +333,7 @@ AL_API ALvoid AL_APIENTRY alGetListener3f(ALenum eParam, ALfloat *pflValue1, ALf
else
alSetError(pContext, AL_INVALID_VALUE);
ProcessContext(pContext);
UnlockContext(pContext);
}
@ -354,7 +354,7 @@ AL_API ALvoid AL_APIENTRY alGetListenerfv(ALenum eParam, ALfloat *pflValues)
return;
}
pContext = GetContextSuspended();
pContext = GetLockedContext();
if(!pContext) return;
if(pflValues)
@ -379,7 +379,7 @@ AL_API ALvoid AL_APIENTRY alGetListenerfv(ALenum eParam, ALfloat *pflValues)
else
alSetError(pContext, AL_INVALID_VALUE);
ProcessContext(pContext);
UnlockContext(pContext);
}
@ -387,7 +387,7 @@ AL_API ALvoid AL_APIENTRY alGetListeneri(ALenum eParam, ALint *plValue)
{
ALCcontext *pContext;
pContext = GetContextSuspended();
pContext = GetLockedContext();
if(!pContext) return;
if(plValue)
@ -402,7 +402,7 @@ AL_API ALvoid AL_APIENTRY alGetListeneri(ALenum eParam, ALint *plValue)
else
alSetError(pContext, AL_INVALID_VALUE);
ProcessContext(pContext);
UnlockContext(pContext);
}
@ -410,7 +410,7 @@ AL_API void AL_APIENTRY alGetListener3i(ALenum eParam, ALint *plValue1, ALint *p
{
ALCcontext *pContext;
pContext = GetContextSuspended();
pContext = GetLockedContext();
if(!pContext) return;
if(plValue1 && plValue2 && plValue3)
@ -437,7 +437,7 @@ AL_API void AL_APIENTRY alGetListener3i(ALenum eParam, ALint *plValue1, ALint *p
else
alSetError(pContext, AL_INVALID_VALUE);
ProcessContext(pContext);
UnlockContext(pContext);
}
@ -453,7 +453,7 @@ AL_API void AL_APIENTRY alGetListeneriv(ALenum eParam, ALint* plValues)
return;
}
pContext = GetContextSuspended();
pContext = GetLockedContext();
if(!pContext) return;
if(plValues)
@ -478,5 +478,5 @@ AL_API void AL_APIENTRY alGetListeneriv(ALenum eParam, ALint* plValues)
else
alSetError(pContext, AL_INVALID_VALUE);
ProcessContext(pContext);
UnlockContext(pContext);
}

View File

@ -61,7 +61,7 @@ AL_API ALvoid AL_APIENTRY alGenSources(ALsizei n,ALuint *sources)
ALCcontext *Context;
ALCdevice *Device;
Context = GetContextSuspended();
Context = GetLockedContext();
if(!Context) return;
Device = Context->Device;
@ -105,7 +105,7 @@ AL_API ALvoid AL_APIENTRY alGenSources(ALsizei n,ALuint *sources)
}
}
ProcessContext(Context);
UnlockContext(Context);
}
@ -117,7 +117,7 @@ AL_API ALvoid AL_APIENTRY alDeleteSources(ALsizei n, const ALuint *sources)
ALbufferlistitem *BufferList;
ALboolean SourcesValid = AL_FALSE;
Context = GetContextSuspended();
Context = GetLockedContext();
if(!Context) return;
if(n < 0)
@ -183,7 +183,7 @@ AL_API ALvoid AL_APIENTRY alDeleteSources(ALsizei n, const ALuint *sources)
}
}
ProcessContext(Context);
UnlockContext(Context);
}
@ -192,12 +192,12 @@ AL_API ALboolean AL_APIENTRY alIsSource(ALuint source)
ALCcontext *Context;
ALboolean result;
Context = GetContextSuspended();
Context = GetLockedContext();
if(!Context) return AL_FALSE;
result = (LookupSource(Context->SourceMap, source) ? AL_TRUE : AL_FALSE);
ProcessContext(Context);
UnlockContext(Context);
return result;
}
@ -208,7 +208,7 @@ AL_API ALvoid AL_APIENTRY alSourcef(ALuint source, ALenum eParam, ALfloat flValu
ALCcontext *pContext;
ALsource *Source;
pContext = GetContextSuspended();
pContext = GetLockedContext();
if(!pContext) return;
if((Source=LookupSource(pContext->SourceMap, source)) != NULL)
@ -389,7 +389,7 @@ AL_API ALvoid AL_APIENTRY alSourcef(ALuint source, ALenum eParam, ALfloat flValu
alSetError(pContext, AL_INVALID_NAME);
}
ProcessContext(pContext);
UnlockContext(pContext);
}
@ -398,7 +398,7 @@ AL_API ALvoid AL_APIENTRY alSource3f(ALuint source, ALenum eParam, ALfloat flVal
ALCcontext *pContext;
ALsource *Source;
pContext = GetContextSuspended();
pContext = GetLockedContext();
if(!pContext) return;
if((Source=LookupSource(pContext->SourceMap, source)) != NULL)
@ -434,7 +434,7 @@ AL_API ALvoid AL_APIENTRY alSource3f(ALuint source, ALenum eParam, ALfloat flVal
else
alSetError(pContext, AL_INVALID_NAME);
ProcessContext(pContext);
UnlockContext(pContext);
}
@ -473,7 +473,7 @@ AL_API ALvoid AL_APIENTRY alSourcefv(ALuint source, ALenum eParam, const ALfloat
}
}
pContext = GetContextSuspended();
pContext = GetLockedContext();
if(!pContext) return;
if(pflValues)
@ -493,7 +493,7 @@ AL_API ALvoid AL_APIENTRY alSourcefv(ALuint source, ALenum eParam, const ALfloat
else
alSetError(pContext, AL_INVALID_VALUE);
ProcessContext(pContext);
UnlockContext(pContext);
}
@ -514,7 +514,7 @@ AL_API ALvoid AL_APIENTRY alSourcei(ALuint source,ALenum eParam,ALint lValue)
return;
}
pContext = GetContextSuspended();
pContext = GetLockedContext();
if(!pContext) return;
if((Source=LookupSource(pContext->SourceMap, source)) != NULL)
@ -715,7 +715,7 @@ AL_API ALvoid AL_APIENTRY alSourcei(ALuint source,ALenum eParam,ALint lValue)
else
alSetError(pContext, AL_INVALID_NAME);
ProcessContext(pContext);
UnlockContext(pContext);
}
@ -733,7 +733,7 @@ AL_API void AL_APIENTRY alSource3i(ALuint source, ALenum eParam, ALint lValue1,
return;
}
pContext = GetContextSuspended();
pContext = GetLockedContext();
if(!pContext) return;
if((Source=LookupSource(pContext->SourceMap, source)) != NULL)
@ -782,7 +782,7 @@ AL_API void AL_APIENTRY alSource3i(ALuint source, ALenum eParam, ALint lValue1,
else
alSetError(pContext, AL_INVALID_NAME);
ProcessContext(pContext);
UnlockContext(pContext);
}
@ -824,7 +824,7 @@ AL_API void AL_APIENTRY alSourceiv(ALuint source, ALenum eParam, const ALint* pl
}
}
pContext = GetContextSuspended();
pContext = GetLockedContext();
if(!pContext) return;
if(plValues)
@ -844,7 +844,7 @@ AL_API void AL_APIENTRY alSourceiv(ALuint source, ALenum eParam, const ALint* pl
else
alSetError(pContext, AL_INVALID_VALUE);
ProcessContext(pContext);
UnlockContext(pContext);
}
@ -855,7 +855,7 @@ AL_API ALvoid AL_APIENTRY alGetSourcef(ALuint source, ALenum eParam, ALfloat *pf
ALdouble Offsets[2];
ALdouble updateLen;
pContext = GetContextSuspended();
pContext = GetLockedContext();
if(!pContext) return;
if(pflValue)
@ -940,7 +940,7 @@ AL_API ALvoid AL_APIENTRY alGetSourcef(ALuint source, ALenum eParam, ALfloat *pf
else
alSetError(pContext, AL_INVALID_VALUE);
ProcessContext(pContext);
UnlockContext(pContext);
}
@ -949,7 +949,7 @@ AL_API ALvoid AL_APIENTRY alGetSource3f(ALuint source, ALenum eParam, ALfloat* p
ALCcontext *pContext;
ALsource *Source;
pContext = GetContextSuspended();
pContext = GetLockedContext();
if(!pContext) return;
if(pflValue1 && pflValue2 && pflValue3)
@ -987,7 +987,7 @@ AL_API ALvoid AL_APIENTRY alGetSource3f(ALuint source, ALenum eParam, ALfloat* p
else
alSetError(pContext, AL_INVALID_VALUE);
ProcessContext(pContext);
UnlockContext(pContext);
}
@ -1027,7 +1027,7 @@ AL_API ALvoid AL_APIENTRY alGetSourcefv(ALuint source, ALenum eParam, ALfloat *p
return;
}
pContext = GetContextSuspended();
pContext = GetLockedContext();
if(!pContext) return;
if(pflValues)
@ -1056,7 +1056,7 @@ AL_API ALvoid AL_APIENTRY alGetSourcefv(ALuint source, ALenum eParam, ALfloat *p
else
alSetError(pContext, AL_INVALID_VALUE);
ProcessContext(pContext);
UnlockContext(pContext);
}
@ -1067,7 +1067,7 @@ AL_API ALvoid AL_APIENTRY alGetSourcei(ALuint source, ALenum eParam, ALint *plVa
ALdouble Offsets[2];
ALdouble updateLen;
pContext = GetContextSuspended();
pContext = GetLockedContext();
if(!pContext) return;
if(plValue)
@ -1179,7 +1179,7 @@ AL_API ALvoid AL_APIENTRY alGetSourcei(ALuint source, ALenum eParam, ALint *plVa
else
alSetError(pContext, AL_INVALID_VALUE);
ProcessContext(pContext);
UnlockContext(pContext);
}
@ -1188,7 +1188,7 @@ AL_API void AL_APIENTRY alGetSource3i(ALuint source, ALenum eParam, ALint* plVal
ALCcontext *pContext;
ALsource *Source;
pContext = GetContextSuspended();
pContext = GetLockedContext();
if(!pContext) return;
if(plValue1 && plValue2 && plValue3)
@ -1226,7 +1226,7 @@ AL_API void AL_APIENTRY alGetSource3i(ALuint source, ALenum eParam, ALint* plVal
else
alSetError(pContext, AL_INVALID_VALUE);
ProcessContext(pContext);
UnlockContext(pContext);
}
@ -1271,7 +1271,7 @@ AL_API void AL_APIENTRY alGetSourceiv(ALuint source, ALenum eParam, ALint* plVal
return;
}
pContext = GetContextSuspended();
pContext = GetLockedContext();
if(!pContext) return;
if(plValues)
@ -1300,7 +1300,7 @@ AL_API void AL_APIENTRY alGetSourceiv(ALuint source, ALenum eParam, ALint* plVal
else
alSetError(pContext, AL_INVALID_VALUE);
ProcessContext(pContext);
UnlockContext(pContext);
}
@ -1316,7 +1316,7 @@ AL_API ALvoid AL_APIENTRY alSourcePlayv(ALsizei n, const ALuint *sources)
ALbufferlistitem *BufferList;
ALsizei i, j;
Context = GetContextSuspended();
Context = GetLockedContext();
if(!Context) return;
if(n < 0)
@ -1423,7 +1423,7 @@ AL_API ALvoid AL_APIENTRY alSourcePlayv(ALsizei n, const ALuint *sources)
}
done:
ProcessContext(Context);
UnlockContext(Context);
}
AL_API ALvoid AL_APIENTRY alSourcePause(ALuint source)
@ -1437,7 +1437,7 @@ AL_API ALvoid AL_APIENTRY alSourcePausev(ALsizei n, const ALuint *sources)
ALsource *Source;
ALsizei i;
Context = GetContextSuspended();
Context = GetLockedContext();
if(!Context) return;
if(n < 0)
@ -1469,7 +1469,7 @@ AL_API ALvoid AL_APIENTRY alSourcePausev(ALsizei n, const ALuint *sources)
}
done:
ProcessContext(Context);
UnlockContext(Context);
}
AL_API ALvoid AL_APIENTRY alSourceStop(ALuint source)
@ -1483,7 +1483,7 @@ AL_API ALvoid AL_APIENTRY alSourceStopv(ALsizei n, const ALuint *sources)
ALsource *Source;
ALsizei i;
Context = GetContextSuspended();
Context = GetLockedContext();
if(!Context) return;
if(n < 0)
@ -1519,7 +1519,7 @@ AL_API ALvoid AL_APIENTRY alSourceStopv(ALsizei n, const ALuint *sources)
}
done:
ProcessContext(Context);
UnlockContext(Context);
}
AL_API ALvoid AL_APIENTRY alSourceRewind(ALuint source)
@ -1533,7 +1533,7 @@ AL_API ALvoid AL_APIENTRY alSourceRewindv(ALsizei n, const ALuint *sources)
ALsource *Source;
ALsizei i;
Context = GetContextSuspended();
Context = GetLockedContext();
if(!Context) return;
if(n < 0)
@ -1573,7 +1573,7 @@ AL_API ALvoid AL_APIENTRY alSourceRewindv(ALsizei n, const ALuint *sources)
}
done:
ProcessContext(Context);
UnlockContext(Context);
}
@ -1591,7 +1591,7 @@ AL_API ALvoid AL_APIENTRY alSourceQueueBuffers(ALuint source, ALsizei n, const A
if(n == 0)
return;
Context = GetContextSuspended();
Context = GetLockedContext();
if(!Context) return;
if(n < 0)
@ -1718,7 +1718,7 @@ AL_API ALvoid AL_APIENTRY alSourceQueueBuffers(ALuint source, ALsizei n, const A
Source->BuffersInQueue += n;
done:
ProcessContext(Context);
UnlockContext(Context);
}
@ -1734,7 +1734,7 @@ AL_API ALvoid AL_APIENTRY alSourceUnqueueBuffers( ALuint source, ALsizei n, ALui
if(n == 0)
return;
Context = GetContextSuspended();
Context = GetLockedContext();
if(!Context) return;
if(n < 0)
@ -1789,7 +1789,7 @@ AL_API ALvoid AL_APIENTRY alSourceUnqueueBuffers( ALuint source, ALsizei n, ALui
Source->BuffersPlayed -= n;
done:
ProcessContext(Context);
UnlockContext(Context);
}

View File

@ -45,7 +45,7 @@ AL_API ALvoid AL_APIENTRY alEnable(ALenum capability)
ALCcontext *Context;
ALboolean updateSources = AL_FALSE;
Context = GetContextSuspended();
Context = GetLockedContext();
if(!Context) return;
switch(capability)
@ -70,7 +70,7 @@ AL_API ALvoid AL_APIENTRY alEnable(ALenum capability)
}
}
ProcessContext(Context);
UnlockContext(Context);
}
AL_API ALvoid AL_APIENTRY alDisable(ALenum capability)
@ -78,7 +78,7 @@ AL_API ALvoid AL_APIENTRY alDisable(ALenum capability)
ALCcontext *Context;
ALboolean updateSources = AL_FALSE;
Context = GetContextSuspended();
Context = GetLockedContext();
if(!Context) return;
switch(capability)
@ -103,7 +103,7 @@ AL_API ALvoid AL_APIENTRY alDisable(ALenum capability)
}
}
ProcessContext(Context);
UnlockContext(Context);
}
AL_API ALboolean AL_APIENTRY alIsEnabled(ALenum capability)
@ -111,7 +111,7 @@ AL_API ALboolean AL_APIENTRY alIsEnabled(ALenum capability)
ALCcontext *Context;
ALboolean value=AL_FALSE;
Context = GetContextSuspended();
Context = GetLockedContext();
if(!Context) return AL_FALSE;
switch(capability)
@ -125,7 +125,7 @@ AL_API ALboolean AL_APIENTRY alIsEnabled(ALenum capability)
break;
}
ProcessContext(Context);
UnlockContext(Context);
return value;
}
@ -135,7 +135,7 @@ AL_API ALboolean AL_APIENTRY alGetBoolean(ALenum pname)
ALCcontext *Context;
ALboolean value=AL_FALSE;
Context = GetContextSuspended();
Context = GetLockedContext();
if(!Context) return AL_FALSE;
switch(pname)
@ -165,7 +165,7 @@ AL_API ALboolean AL_APIENTRY alGetBoolean(ALenum pname)
break;
}
ProcessContext(Context);
UnlockContext(Context);
return value;
}
@ -175,7 +175,7 @@ AL_API ALdouble AL_APIENTRY alGetDouble(ALenum pname)
ALCcontext *Context;
ALdouble value = 0.0;
Context = GetContextSuspended();
Context = GetLockedContext();
if(!Context) return 0.0;
switch(pname)
@ -201,7 +201,7 @@ AL_API ALdouble AL_APIENTRY alGetDouble(ALenum pname)
break;
}
ProcessContext(Context);
UnlockContext(Context);
return value;
}
@ -211,7 +211,7 @@ AL_API ALfloat AL_APIENTRY alGetFloat(ALenum pname)
ALCcontext *Context;
ALfloat value = 0.0f;
Context = GetContextSuspended();
Context = GetLockedContext();
if(!Context) return 0.0f;
switch(pname)
@ -237,7 +237,7 @@ AL_API ALfloat AL_APIENTRY alGetFloat(ALenum pname)
break;
}
ProcessContext(Context);
UnlockContext(Context);
return value;
}
@ -247,7 +247,7 @@ AL_API ALint AL_APIENTRY alGetInteger(ALenum pname)
ALCcontext *Context;
ALint value = 0;
Context = GetContextSuspended();
Context = GetLockedContext();
if(!Context) return 0;
switch(pname)
@ -273,7 +273,7 @@ AL_API ALint AL_APIENTRY alGetInteger(ALenum pname)
break;
}
ProcessContext(Context);
UnlockContext(Context);
return value;
}
@ -282,7 +282,7 @@ AL_API ALvoid AL_APIENTRY alGetBooleanv(ALenum pname,ALboolean *data)
{
ALCcontext *Context;
Context = GetContextSuspended();
Context = GetLockedContext();
if(!Context) return;
if(data)
@ -316,14 +316,14 @@ AL_API ALvoid AL_APIENTRY alGetBooleanv(ALenum pname,ALboolean *data)
alSetError(Context, AL_INVALID_VALUE);
}
ProcessContext(Context);
UnlockContext(Context);
}
AL_API ALvoid AL_APIENTRY alGetDoublev(ALenum pname,ALdouble *data)
{
ALCcontext *Context;
Context = GetContextSuspended();
Context = GetLockedContext();
if(!Context) return;
if(data)
@ -357,14 +357,14 @@ AL_API ALvoid AL_APIENTRY alGetDoublev(ALenum pname,ALdouble *data)
alSetError(Context, AL_INVALID_VALUE);
}
ProcessContext(Context);
UnlockContext(Context);
}
AL_API ALvoid AL_APIENTRY alGetFloatv(ALenum pname,ALfloat *data)
{
ALCcontext *Context;
Context = GetContextSuspended();
Context = GetLockedContext();
if(!Context) return;
if(data)
@ -398,14 +398,14 @@ AL_API ALvoid AL_APIENTRY alGetFloatv(ALenum pname,ALfloat *data)
alSetError(Context, AL_INVALID_VALUE);
}
ProcessContext(Context);
UnlockContext(Context);
}
AL_API ALvoid AL_APIENTRY alGetIntegerv(ALenum pname,ALint *data)
{
ALCcontext *Context;
Context = GetContextSuspended();
Context = GetLockedContext();
if(!Context) return;
if(data)
@ -439,7 +439,7 @@ AL_API ALvoid AL_APIENTRY alGetIntegerv(ALenum pname,ALint *data)
alSetError(Context, AL_INVALID_VALUE);
}
ProcessContext(Context);
UnlockContext(Context);
}
AL_API const ALchar* AL_APIENTRY alGetString(ALenum pname)
@ -447,7 +447,7 @@ AL_API const ALchar* AL_APIENTRY alGetString(ALenum pname)
const ALchar *value;
ALCcontext *pContext;
pContext = GetContextSuspended();
pContext = GetLockedContext();
if(!pContext) return NULL;
switch(pname)
@ -498,7 +498,7 @@ AL_API const ALchar* AL_APIENTRY alGetString(ALenum pname)
break;
}
ProcessContext(pContext);
UnlockContext(pContext);
return value;
}
@ -508,7 +508,7 @@ AL_API ALvoid AL_APIENTRY alDopplerFactor(ALfloat value)
ALCcontext *Context;
ALboolean updateSources = AL_FALSE;
Context = GetContextSuspended();
Context = GetLockedContext();
if(!Context) return;
if(value >= 0.0f)
@ -531,7 +531,7 @@ AL_API ALvoid AL_APIENTRY alDopplerFactor(ALfloat value)
}
}
ProcessContext(Context);
UnlockContext(Context);
}
AL_API ALvoid AL_APIENTRY alDopplerVelocity(ALfloat value)
@ -539,7 +539,7 @@ AL_API ALvoid AL_APIENTRY alDopplerVelocity(ALfloat value)
ALCcontext *Context;
ALboolean updateSources = AL_FALSE;
Context = GetContextSuspended();
Context = GetLockedContext();
if(!Context) return;
if(value > 0.0f)
@ -560,7 +560,7 @@ AL_API ALvoid AL_APIENTRY alDopplerVelocity(ALfloat value)
}
}
ProcessContext(Context);
UnlockContext(Context);
}
AL_API ALvoid AL_APIENTRY alSpeedOfSound(ALfloat flSpeedOfSound)
@ -568,7 +568,7 @@ AL_API ALvoid AL_APIENTRY alSpeedOfSound(ALfloat flSpeedOfSound)
ALCcontext *pContext;
ALboolean updateSources = AL_FALSE;
pContext = GetContextSuspended();
pContext = GetLockedContext();
if(!pContext) return;
if(flSpeedOfSound > 0.0f)
@ -589,7 +589,7 @@ AL_API ALvoid AL_APIENTRY alSpeedOfSound(ALfloat flSpeedOfSound)
}
}
ProcessContext(pContext);
UnlockContext(pContext);
}
AL_API ALvoid AL_APIENTRY alDistanceModel(ALenum value)
@ -597,7 +597,7 @@ AL_API ALvoid AL_APIENTRY alDistanceModel(ALenum value)
ALCcontext *Context;
ALboolean updateSources = AL_FALSE;
Context = GetContextSuspended();
Context = GetLockedContext();
if(!Context) return;
switch(value)
@ -628,5 +628,5 @@ AL_API ALvoid AL_APIENTRY alDistanceModel(ALenum value)
}
}
ProcessContext(Context);
UnlockContext(Context);
}