diff options
author | Chris Robinson <[email protected]> | 2015-10-24 16:31:28 -0700 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2015-10-24 16:31:28 -0700 |
commit | a57fe89050a1cf909021f2f94e6d96e44e96aa89 (patch) | |
tree | 3615f605ece6b91baa5c5ff701ae047eb81c5441 /OpenAL32/alSource.c | |
parent | 298fdb220d2fe13b2c12d842ad40f39d9cf70e51 (diff) |
Lock the source queue for writing when updating the playback offset
Diffstat (limited to 'OpenAL32/alSource.c')
-rw-r--r-- | OpenAL32/alSource.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/OpenAL32/alSource.c b/OpenAL32/alSource.c index b8677539..0d454882 100644 --- a/OpenAL32/alSource.c +++ b/OpenAL32/alSource.c @@ -494,14 +494,14 @@ static ALboolean SetSourcefv(ALsource *Source, ALCcontext *Context, SourceProp p if((Source->state == AL_PLAYING || Source->state == AL_PAUSED) && !Context->DeferUpdates) { - ReadLock(&Source->queue_lock); + WriteLock(&Source->queue_lock); if(ApplyOffset(Source) == AL_FALSE) { - ReadUnlock(&Source->queue_lock); + WriteUnlock(&Source->queue_lock); UnlockContext(Context); SET_ERROR_AND_RETURN_VALUE(Context, AL_INVALID_VALUE, AL_FALSE); } - ReadUnlock(&Source->queue_lock); + WriteUnlock(&Source->queue_lock); } UnlockContext(Context); return AL_TRUE; @@ -676,14 +676,14 @@ static ALboolean SetSourceiv(ALsource *Source, ALCcontext *Context, SourceProp p if((Source->state == AL_PLAYING || Source->state == AL_PAUSED) && !Context->DeferUpdates) { - ReadLock(&Source->queue_lock); + WriteLock(&Source->queue_lock); if(ApplyOffset(Source) == AL_FALSE) { - ReadUnlock(&Source->queue_lock); + WriteUnlock(&Source->queue_lock); UnlockContext(Context); SET_ERROR_AND_RETURN_VALUE(Context, AL_INVALID_VALUE, AL_FALSE); } - ReadUnlock(&Source->queue_lock); + WriteUnlock(&Source->queue_lock); } UnlockContext(Context); return AL_TRUE; @@ -2569,7 +2569,7 @@ static ALvoid InitSourceParams(ALsource *Source) */ ALvoid SetSourceState(ALsource *Source, ALCcontext *Context, ALenum state) { - ReadLock(&Source->queue_lock); + WriteLock(&Source->queue_lock); if(state == AL_PLAYING) { ALCdevice *device = Context->Device; @@ -2695,7 +2695,7 @@ ALvoid SetSourceState(ALsource *Source, ALCcontext *Context, ALenum state) } Source->Offset = -1.0; } - ReadUnlock(&Source->queue_lock); + WriteUnlock(&Source->queue_lock); } /* GetSourceSampleOffset |