diff options
author | Chris Robinson <[email protected]> | 2020-02-20 23:53:56 -0800 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2020-02-20 23:53:56 -0800 |
commit | 9b43327f56649fb46ed0b939ac05ff6c95d1a998 (patch) | |
tree | 9bb10641e2ace1308f8f4a88f81e276c91e76c61 /alc | |
parent | bdb8ef22b02fb278017d95c70d36e6b815533de9 (diff) |
Asynchronously stop and rewind voices
Diffstat (limited to 'alc')
-rw-r--r-- | alc/alu.cpp | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/alc/alu.cpp b/alc/alu.cpp index 748338ab..6d67756c 100644 --- a/alc/alu.cpp +++ b/alc/alu.cpp @@ -1629,10 +1629,9 @@ void ProcessVoiceChanges(ALCcontext *ctx) cur = next; bool success{false}; - ALvoice *voice{cur->mVoice}; if(cur->mState == AL_INITIAL || cur->mState == AL_STOPPED) { - if(voice) + if(ALvoice *voice{cur->mVoice}) { voice->mCurrentBuffer.store(nullptr, std::memory_order_relaxed); voice->mLoopBuffer.store(nullptr, std::memory_order_relaxed); @@ -1644,7 +1643,7 @@ void ProcessVoiceChanges(ALCcontext *ctx) } success |= (cur->mState == AL_INITIAL); } - if(success && (enabledevt&EventType_SourceStateChange)) + if(success && (enabledevt&EventType_SourceStateChange) && cur->mSourceID != 0) SendSourceStateEvent(ctx, cur->mSourceID, cur->mState); } while((next=cur->mNext.load(std::memory_order_acquire))); ctx->mCurrentVoiceChange.store(cur, std::memory_order_release); |