aboutsummaryrefslogtreecommitdiffstats
path: root/OpenAL32
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2018-11-26 18:25:29 -0800
committerChris Robinson <[email protected]>2018-11-26 18:25:29 -0800
commit75b39cafc8b747a0f468382a9e4a64793a231b98 (patch)
tree8c886a8a9708296eb5ee471367ee9107cc2e6025 /OpenAL32
parentdf3dcc879f6c037efcb1285f08d70c76cd570bee (diff)
Get rid of some unnecessary functions
Diffstat (limited to 'OpenAL32')
-rw-r--r--OpenAL32/Include/alMain.h10
-rw-r--r--OpenAL32/alSource.cpp16
2 files changed, 6 insertions, 20 deletions
diff --git a/OpenAL32/Include/alMain.h b/OpenAL32/Include/alMain.h
index 297ff06f..cb2181da 100644
--- a/OpenAL32/Include/alMain.h
+++ b/OpenAL32/Include/alMain.h
@@ -884,16 +884,6 @@ inline ALint GetChannelIdxByName(const RealMixParams *real, enum Channel chan)
{ return GetChannelIndex(real->ChannelName, chan); }
-inline void LockBufferList(ALCdevice *device) { almtx_lock(&device->BufferLock); }
-inline void UnlockBufferList(ALCdevice *device) { almtx_unlock(&device->BufferLock); }
-
-inline void LockEffectList(ALCdevice *device) { almtx_lock(&device->EffectLock); }
-inline void UnlockEffectList(ALCdevice *device) { almtx_unlock(&device->EffectLock); }
-
-inline void LockFilterList(ALCdevice *device) { almtx_lock(&device->FilterLock); }
-inline void UnlockFilterList(ALCdevice *device) { almtx_unlock(&device->FilterLock); }
-
-
void StartEventThrd(ALCcontext *ctx);
void StopEventThrd(ALCcontext *ctx);
diff --git a/OpenAL32/alSource.cpp b/OpenAL32/alSource.cpp
index e58d6314..37805376 100644
--- a/OpenAL32/alSource.cpp
+++ b/OpenAL32/alSource.cpp
@@ -1208,6 +1208,7 @@ ALboolean SetSourceiv(ALsource *Source, ALCcontext *Context, SourceProp prop, co
ALeffectslot *slot{nullptr};
ALbufferlistitem *oldlist{nullptr};
std::unique_lock<almtx_t> slotlock;
+ std::unique_lock<almtx_t> filtlock;
std::unique_lock<almtx_t> buflock;
ALfloat fvals[6];
@@ -1335,13 +1336,10 @@ ALboolean SetSourceiv(ALsource *Source, ALCcontext *Context, SourceProp prop, co
return AL_TRUE;
case AL_DIRECT_FILTER:
- LockFilterList(device);
+ filtlock = std::unique_lock<almtx_t>{device->FilterLock};
if(!(*values == 0 || (filter=LookupFilter(device, *values)) != nullptr))
- {
- UnlockFilterList(device);
SETERR_RETURN(Context, AL_INVALID_VALUE, AL_FALSE, "Invalid filter ID %u",
*values);
- }
if(!filter)
{
@@ -1359,7 +1357,7 @@ ALboolean SetSourceiv(ALsource *Source, ALCcontext *Context, SourceProp prop, co
Source->Direct.GainLF = filter->GainLF;
Source->Direct.LFReference = filter->LFReference;
}
- UnlockFilterList(device);
+ filtlock.unlock();
DO_UPDATEPROPS();
return AL_TRUE;
@@ -1427,13 +1425,11 @@ ALboolean SetSourceiv(ALsource *Source, ALCcontext *Context, SourceProp prop, co
values[0]);
if((ALuint)values[1] >= (ALuint)device->NumAuxSends)
SETERR_RETURN(Context, AL_INVALID_VALUE, AL_FALSE, "Invalid send %u", values[1]);
- LockFilterList(device);
+
+ filtlock = std::unique_lock<almtx_t>{device->FilterLock};
if(!(values[2] == 0 || (filter=LookupFilter(device, values[2])) != nullptr))
- {
- UnlockFilterList(device);
SETERR_RETURN(Context, AL_INVALID_VALUE, AL_FALSE, "Invalid filter ID %u",
values[2]);
- }
if(!filter)
{
@@ -1452,7 +1448,7 @@ ALboolean SetSourceiv(ALsource *Source, ALCcontext *Context, SourceProp prop, co
Source->Send[values[1]].GainLF = filter->GainLF;
Source->Send[values[1]].LFReference = filter->LFReference;
}
- UnlockFilterList(device);
+ filtlock.unlock();
if(slot != Source->Send[values[1]].Slot && IsPlayingOrPaused(Source))
{