diff options
author | Chris Robinson <[email protected]> | 2014-07-31 07:20:36 -0700 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2014-07-31 07:20:36 -0700 |
commit | 15a58eb38375247b6c57a7ceab5aa74895d638cd (patch) | |
tree | 5f546bab5504768356c27903a02b271c619b7d09 /Alc/ALu.c | |
parent | cdfc5a4d31d17e156736bb8bdcaf93ea505237ac (diff) |
Make the source's buffer queue head and current queue item atomic
Diffstat (limited to 'Alc/ALu.c')
-rw-r--r-- | Alc/ALu.c | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -260,7 +260,7 @@ ALvoid CalcNonAttnSourceParams(ALactivesource *src, const ALCcontext *ALContext) /* Calculate the stepping value */ Channels = FmtMono; - BufferListItem = ALSource->queue; + BufferListItem = ATOMIC_LOAD(&ALSource->queue); while(BufferListItem != NULL) { ALbuffer *ALBuffer; @@ -872,7 +872,7 @@ ALvoid CalcSourceParams(ALactivesource *src, const ALCcontext *ALContext) clampf(SpeedOfSound-VSS, 1.0f, SpeedOfSound*2.0f - 1.0f); } - BufferListItem = ALSource->queue; + BufferListItem = ATOMIC_LOAD(&ALSource->queue); while(BufferListItem != NULL) { ALbuffer *ALBuffer; @@ -1308,7 +1308,7 @@ ALvoid aluHandleDisconnect(ALCdevice *device) if(source->state == AL_PLAYING) { source->state = AL_STOPPED; - source->current_buffer = NULL; + ATOMIC_STORE(&source->current_buffer, NULL); source->position = 0; source->position_fraction = 0; } |