aboutsummaryrefslogtreecommitdiffstats
path: root/al
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2023-02-18 17:27:19 -0800
committerChris Robinson <[email protected]>2023-02-18 17:27:19 -0800
commitd66107e9f008770b48f0df4fce041ee3e501e1e8 (patch)
tree561f89aa656655985572be05d546136bac5b9d77 /al
parent9f49f6cab06374d6f5a4e1ab63f1532bf79d4cb2 (diff)
Don't start with fading for negative offsets
Diffstat (limited to 'al')
-rw-r--r--al/source.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/al/source.cpp b/al/source.cpp
index d3468628..8e323445 100644
--- a/al/source.cpp
+++ b/al/source.cpp
@@ -649,7 +649,8 @@ bool SetVoiceOffset(Voice *oldvoice, const VoicePos &vpos, ALsource *source, ALC
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())
+ if(vpos.pos > 0 || (vpos.pos == 0 && vpos.frac > 0)
+ || vpos.bufferitem != &source->mQueue.front())
newvoice->mFlags.set(VoiceIsFading);
InitVoice(newvoice, source, vpos.bufferitem, context, device);
source->VoiceIdx = vidx;
@@ -2649,7 +2650,8 @@ void StartSources(ALCcontext *const context, const al::span<ALsource*> srchandle
voice->mPosition.store(vpos->pos, std::memory_order_relaxed);
voice->mPositionFrac.store(vpos->frac, std::memory_order_relaxed);
voice->mCurrentBuffer.store(vpos->bufferitem, std::memory_order_relaxed);
- if(vpos->pos!=0 || vpos->frac!=0 || vpos->bufferitem!=&source->mQueue.front())
+ if(vpos->pos > 0 || (vpos->pos == 0 && vpos->frac > 0)
+ || vpos->bufferitem != &source->mQueue.front())
voice->mFlags.set(VoiceIsFading);
}
}