diff options
author | Chris Robinson <[email protected]> | 2022-11-03 02:17:54 -0700 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2022-11-03 02:17:54 -0700 |
commit | d8361bdd6fa807a4200e18e8ef7ffd13ab849b74 (patch) | |
tree | 1df40b4006ade3e715c84701916fab23af65d612 /al/source.cpp | |
parent | b73e0ecbc55cb09788d056131aaec0ed27f6046a (diff) |
Add the ability to start a voice at a particular time
Diffstat (limited to 'al/source.cpp')
-rw-r--r-- | al/source.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/al/source.cpp b/al/source.cpp index 6daa3f4e..93f3285b 100644 --- a/al/source.cpp +++ b/al/source.cpp @@ -644,6 +644,7 @@ bool SetVoiceOffset(Voice *oldvoice, const VoicePos &vpos, ALsource *source, ALC newvoice->mPosition.store(vpos.pos, std::memory_order_relaxed); newvoice->mPositionFrac.store(vpos.frac, std::memory_order_relaxed); newvoice->mCurrentBuffer.store(vpos.bufferitem, std::memory_order_relaxed); + newvoice->mStartTime = oldvoice->mStartTime; newvoice->mFlags.reset(); if(vpos.pos > 0 || vpos.frac > 0 || vpos.bufferitem != &source->mQueue.front()) newvoice->mFlags.set(VoiceIsFading); @@ -3198,6 +3199,7 @@ START_API_FUNC voice->mPosition.store(0, std::memory_order_relaxed); voice->mPositionFrac.store(0, std::memory_order_relaxed); voice->mCurrentBuffer.store(&source->mQueue.front(), std::memory_order_relaxed); + voice->mStartTime = std::chrono::nanoseconds::min(); voice->mFlags.reset(); /* A source that's not playing or paused has any offset applied when it * starts playing. |