aboutsummaryrefslogtreecommitdiffstats
path: root/OpenAL32/alState.c
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2016-08-26 19:46:46 -0700
committerChris Robinson <[email protected]>2016-08-26 21:19:38 -0700
commit4b153dade82b0558c96d54828bd2f9f86dc808fd (patch)
treef8bdb9f899633d8850c614232808392a7430ea58 /OpenAL32/alState.c
parentef03de39814486a1d91949cfff8b6a33bd137f91 (diff)
Allow sources to play while alcSuspendContext is in effect
This appears to be how Creative's Windows drivers handle it, and is necessary for at least the Windows version of UT2k4 (otherwise it tries to play a source while suspended, checks and sees it's stopped, then kills it before it's given a chance to start playing). Consequently, the internal properties it gets mixed with are determined by what the source properties are at the time of the play call, and the listener properties at the time of the suspend call. This does not change alDeferUpdatesSOFT, which will still hold the play state change until alProcessUpdatesSOFT.
Diffstat (limited to 'OpenAL32/alState.c')
-rw-r--r--OpenAL32/alState.c17
1 files changed, 11 insertions, 6 deletions
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);
}