aboutsummaryrefslogtreecommitdiffstats
path: root/alc
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2020-02-21 04:29:32 -0800
committerChris Robinson <[email protected]>2020-02-21 04:29:32 -0800
commit0694df901437568ce4699ae3c8a3e003eea0ceb7 (patch)
treed09309a6d7225d83cc9f11eb939e1054cedf5a3f /alc
parent9887c6971de48c3a86e3dddf24031ebb986b495a (diff)
Handle playing and pausing with VoiceChanges
Diffstat (limited to 'alc')
-rw-r--r--alc/alu.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/alc/alu.cpp b/alc/alu.cpp
index 6d67756c..9039fb9c 100644
--- a/alc/alu.cpp
+++ b/alc/alu.cpp
@@ -1643,6 +1643,19 @@ void ProcessVoiceChanges(ALCcontext *ctx)
}
success |= (cur->mState == AL_INITIAL);
}
+ else if(cur->mState == AL_PAUSED)
+ {
+ ALvoice *voice{cur->mVoice};
+ ALvoice::State oldvstate{ALvoice::Playing};
+ success = voice->mPlayState.compare_exchange_strong(oldvstate, ALvoice::Stopping,
+ std::memory_order_release, std::memory_order_acquire);
+ }
+ else if(cur->mState == AL_PLAYING)
+ {
+ ALvoice *voice{cur->mVoice};
+ voice->mPlayState.store(ALvoice::Playing, std::memory_order_release);
+ success = true;
+ }
if(success && (enabledevt&EventType_SourceStateChange) && cur->mSourceID != 0)
SendSourceStateEvent(ctx, cur->mSourceID, cur->mState);
} while((next=cur->mNext.load(std::memory_order_acquire)));