diff options
author | Chris Robinson <[email protected]> | 2020-02-20 19:18:07 -0800 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2020-02-20 19:18:07 -0800 |
commit | acf7f6f74e3b5d133fd121093e8ccf301a8697cd (patch) | |
tree | fe8ededc3faa46a3368247e3a29110db3d49de74 /alc | |
parent | 642ef4edc914bd75d6e994ab2e42e03a87d1d8da (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.h | 11 |
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), |