aboutsummaryrefslogtreecommitdiffstats
path: root/al/source.cpp
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2022-11-03 02:17:54 -0700
committerChris Robinson <[email protected]>2022-11-03 02:17:54 -0700
commitd8361bdd6fa807a4200e18e8ef7ffd13ab849b74 (patch)
tree1df40b4006ade3e715c84701916fab23af65d612 /al/source.cpp
parentb73e0ecbc55cb09788d056131aaec0ed27f6046a (diff)
Add the ability to start a voice at a particular time
Diffstat (limited to 'al/source.cpp')
-rw-r--r--al/source.cpp2
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.