aboutsummaryrefslogtreecommitdiffstats
path: root/OpenAL32/alSource.c
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2011-08-21 00:49:04 -0700
committerChris Robinson <[email protected]>2011-08-21 00:49:04 -0700
commit858592832f7adf39dd1983ff72ebeda75cc4dd16 (patch)
tree1c6c4b363cd1dbb2bccdf00fe30cb169fdd1331a /OpenAL32/alSource.c
parenta97211b5724a4d31fb9dff93a62d941d55cbd041 (diff)
Defer source offset changes requested by the app
Diffstat (limited to 'OpenAL32/alSource.c')
-rw-r--r--OpenAL32/alSource.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/OpenAL32/alSource.c b/OpenAL32/alSource.c
index 8fea0f91..532d5178 100644
--- a/OpenAL32/alSource.c
+++ b/OpenAL32/alSource.c
@@ -48,7 +48,6 @@ const ALsizei ResamplerPrePadding[RESAMPLER_MAX] = {
static ALvoid InitSourceParams(ALsource *Source);
static ALvoid GetSourceOffset(ALsource *Source, ALenum eName, ALdouble *Offsets, ALdouble updateLen);
-static ALboolean ApplyOffset(ALsource *Source);
static ALint GetByteOffset(ALsource *Source);
#define LookupSource(m, k) ((ALsource*)LookupUIntMapKey(&(m), (k)))
@@ -368,7 +367,8 @@ AL_API ALvoid AL_APIENTRY alSourcef(ALuint source, ALenum eParam, ALfloat flValu
else
Source->lOffset = (ALint)flValue;
- if ((Source->state == AL_PLAYING) || (Source->state == AL_PAUSED))
+ if((Source->state == AL_PLAYING || Source->state == AL_PAUSED) &&
+ !pContext->DeferUpdates)
{
if(ApplyOffset(Source) == AL_FALSE)
alSetError(pContext, AL_INVALID_VALUE);
@@ -636,7 +636,8 @@ AL_API ALvoid AL_APIENTRY alSourcei(ALuint source,ALenum eParam,ALint lValue)
else
Source->lOffset = lValue;
- if(Source->state == AL_PLAYING || Source->state == AL_PAUSED)
+ if((Source->state == AL_PLAYING || Source->state == AL_PAUSED) &&
+ !pContext->DeferUpdates)
{
if(ApplyOffset(Source) == AL_FALSE)
alSetError(pContext, AL_INVALID_VALUE);
@@ -2016,7 +2017,7 @@ static ALvoid GetSourceOffset(ALsource *Source, ALenum name, ALdouble *offset, A
Apply a playback offset to the Source. This function will update the queue (to correctly
mark buffers as 'pending' or 'processed' depending upon the new offset.
*/
-static ALboolean ApplyOffset(ALsource *Source)
+ALboolean ApplyOffset(ALsource *Source)
{
const ALbufferlistitem *BufferList;
const ALbuffer *Buffer;