aboutsummaryrefslogtreecommitdiffstats
path: root/alc
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2020-02-20 19:18:07 -0800
committerChris Robinson <[email protected]>2020-02-20 19:18:07 -0800
commitacf7f6f74e3b5d133fd121093e8ccf301a8697cd (patch)
treefe8ededc3faa46a3368247e3a29110db3d49de74 /alc
parent642ef4edc914bd75d6e994ab2e42e03a87d1d8da (diff)
Add a voice flag to indicate a voice has a pending stop
Pending/asynchronous stops to be implemented soon.
Diffstat (limited to 'alc')
-rw-r--r--alc/voice.h11
1 files changed, 7 insertions, 4 deletions
diff --git a/alc/voice.h b/alc/voice.h
index 73344271..e8daa0c7 100644
--- a/alc/voice.h
+++ b/alc/voice.h
@@ -199,10 +199,11 @@ struct ALvoice {
std::atomic<ALvoiceProps*> mUpdate{nullptr};
+ ALvoicePropsBase mProps;
+
std::atomic<ALuint> mSourceID{0u};
std::atomic<State> mPlayState{Stopped};
-
- ALvoicePropsBase mProps;
+ std::atomic<bool> mPendingStop{false};
/**
* Source offset in samples, relative to the currently playing buffer, NOT
@@ -268,11 +269,13 @@ struct ALvoice {
mUpdate.store(rhs.mUpdate.exchange(old_update, std::memory_order_relaxed),
std::memory_order_relaxed);
+ mProps = rhs.mProps;
+
mSourceID.store(rhs.mSourceID.load(std::memory_order_relaxed), std::memory_order_relaxed);
mPlayState.store(rhs.mPlayState.load(std::memory_order_relaxed),
std::memory_order_relaxed);
-
- mProps = rhs.mProps;
+ mPendingStop.store(rhs.mPendingStop.load(std::memory_order_relaxed),
+ std::memory_order_relaxed);
mPosition.store(rhs.mPosition.load(std::memory_order_relaxed), std::memory_order_relaxed);
mPositionFrac.store(rhs.mPositionFrac.load(std::memory_order_relaxed),