aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Alc/ALc.c6
-rw-r--r--OpenAL32/Include/alMain.h8
-rw-r--r--OpenAL32/alSource.c2
-rw-r--r--OpenAL32/alState.c17
4 files changed, 22 insertions, 11 deletions
diff --git a/Alc/ALc.c b/Alc/ALc.c
index b95c90f8..26cdc771 100644
--- a/Alc/ALc.c
+++ b/Alc/ALc.c
@@ -1584,9 +1584,9 @@ extern inline ALint GetChannelIndex(const enum Channel names[MAX_OUTPUT_CHANNELS
* does *NOT* stop mixing, but rather prevents certain property changes from
* taking effect.
*/
-void ALCcontext_DeferUpdates(ALCcontext *context)
+void ALCcontext_DeferUpdates(ALCcontext *context, ALenum type)
{
- ATOMIC_STORE(&context->DeferUpdates, AL_TRUE);
+ ATOMIC_STORE(&context->DeferUpdates, type);
}
/* ALCcontext_ProcessUpdates
@@ -2545,7 +2545,7 @@ ALC_API ALCvoid ALC_APIENTRY alcSuspendContext(ALCcontext *context)
alcSetError(NULL, ALC_INVALID_CONTEXT);
else
{
- ALCcontext_DeferUpdates(context);
+ ALCcontext_DeferUpdates(context, DeferAllowPlay);
ALCcontext_DecRef(context);
}
}
diff --git a/OpenAL32/Include/alMain.h b/OpenAL32/Include/alMain.h
index e0e1b835..74f967ae 100644
--- a/OpenAL32/Include/alMain.h
+++ b/OpenAL32/Include/alMain.h
@@ -772,7 +772,7 @@ void AppendCaptureDeviceList(const ALCchar *name);
void ALCdevice_Lock(ALCdevice *device);
void ALCdevice_Unlock(ALCdevice *device);
-void ALCcontext_DeferUpdates(ALCcontext *context);
+void ALCcontext_DeferUpdates(ALCcontext *context, ALenum type);
void ALCcontext_ProcessUpdates(ALCcontext *context);
inline void LockContext(ALCcontext *context)
@@ -781,6 +781,12 @@ inline void LockContext(ALCcontext *context)
inline void UnlockContext(ALCcontext *context)
{ ALCdevice_Unlock(context->Device); }
+enum {
+ DeferOff = AL_FALSE,
+ DeferAll,
+ DeferAllowPlay
+};
+
typedef struct {
#ifdef HAVE_FENV_H
diff --git a/OpenAL32/alSource.c b/OpenAL32/alSource.c
index f5941729..a7d7f35c 100644
--- a/OpenAL32/alSource.c
+++ b/OpenAL32/alSource.c
@@ -2316,7 +2316,7 @@ AL_API ALvoid AL_APIENTRY alSourcePlayv(ALsizei n, const ALuint *sources)
context->MaxVoices = newcount;
}
- if(ATOMIC_LOAD(&context->DeferUpdates, almemory_order_acquire))
+ if(ATOMIC_LOAD(&context->DeferUpdates, almemory_order_acquire) == DeferAll)
{
for(i = 0;i < n;i++)
{
diff --git a/OpenAL32/alState.c b/OpenAL32/alState.c
index fa3b190a..330d7fe2 100644
--- a/OpenAL32/alState.c
+++ b/OpenAL32/alState.c
@@ -150,7 +150,8 @@ AL_API ALboolean AL_APIENTRY alGetBoolean(ALenum pname)
break;
case AL_DEFERRED_UPDATES_SOFT:
- value = ATOMIC_LOAD(&context->DeferUpdates, almemory_order_acquire);
+ if(ATOMIC_LOAD(&context->DeferUpdates, almemory_order_acquire) == DeferAll)
+ value = AL_TRUE;
break;
default:
@@ -190,7 +191,8 @@ AL_API ALdouble AL_APIENTRY alGetDouble(ALenum pname)
break;
case AL_DEFERRED_UPDATES_SOFT:
- value = (ALdouble)ATOMIC_LOAD(&context->DeferUpdates, almemory_order_acquire);
+ if(ATOMIC_LOAD(&context->DeferUpdates, almemory_order_acquire) == DeferAll)
+ value = (ALdouble)AL_TRUE;
break;
default:
@@ -230,7 +232,8 @@ AL_API ALfloat AL_APIENTRY alGetFloat(ALenum pname)
break;
case AL_DEFERRED_UPDATES_SOFT:
- value = (ALfloat)ATOMIC_LOAD(&context->DeferUpdates, almemory_order_acquire);
+ if(ATOMIC_LOAD(&context->DeferUpdates, almemory_order_acquire) == DeferAll)
+ value = (ALfloat)AL_TRUE;
break;
default:
@@ -270,7 +273,8 @@ AL_API ALint AL_APIENTRY alGetInteger(ALenum pname)
break;
case AL_DEFERRED_UPDATES_SOFT:
- value = (ALint)ATOMIC_LOAD(&context->DeferUpdates, almemory_order_acquire);
+ if(ATOMIC_LOAD(&context->DeferUpdates, almemory_order_acquire) == DeferAll)
+ value = (ALint)AL_TRUE;
break;
default:
@@ -310,7 +314,8 @@ AL_API ALint64SOFT AL_APIENTRY alGetInteger64SOFT(ALenum pname)
break;
case AL_DEFERRED_UPDATES_SOFT:
- value = (ALint64SOFT)ATOMIC_LOAD(&context->DeferUpdates, almemory_order_acquire);
+ if(ATOMIC_LOAD(&context->DeferUpdates, almemory_order_acquire) == DeferAll)
+ value = (ALint64SOFT)AL_TRUE;
break;
default:
@@ -638,7 +643,7 @@ AL_API ALvoid AL_APIENTRY alDeferUpdatesSOFT(void)
context = GetContextRef();
if(!context) return;
- ALCcontext_DeferUpdates(context);
+ ALCcontext_DeferUpdates(context, DeferAll);
ALCcontext_DecRef(context);
}