aboutsummaryrefslogtreecommitdiffstats
path: root/al
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2020-02-17 17:34:17 -0800
committerChris Robinson <[email protected]>2020-02-17 17:34:17 -0800
commitd4e01a181837592d7a86bab9f8b24b4f3467f90e (patch)
treef92a381d417933f47f0f10dd919009999be88eb8 /al
parent04e5b23286063194d81af09f959124d6634e485e (diff)
Flag the voice as callback-based when given a callback buffer
Diffstat (limited to 'al')
-rw-r--r--al/source.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/al/source.cpp b/al/source.cpp
index 07a9d9e0..b18ebe5d 100644
--- a/al/source.cpp
+++ b/al/source.cpp
@@ -2702,7 +2702,12 @@ START_API_FUNC
*/
ALbufferlistitem *BufferList{source->queue};
while(BufferList && BufferList->mSampleLen == 0)
+ {
+ ALbuffer *buffer{BufferList->mBuffer};
+ if(buffer && buffer->Callback) break;
+
BufferList = BufferList->mNext.load(std::memory_order_relaxed);
+ }
/* If there's nothing to play, go right to stopped. */
if UNLIKELY(!BufferList)
@@ -2800,7 +2805,8 @@ START_API_FUNC
voice->mStep = 0;
voice->mFlags = start_fading ? VOICE_IS_FADING : 0;
- if(source->SourceType == AL_STATIC) voice->mFlags |= VOICE_IS_STATIC;
+ if(buffer->Callback) voice->mFlags |= VOICE_IS_CALLBACK;
+ else if(source->SourceType == AL_STATIC) voice->mFlags |= VOICE_IS_STATIC;
voice->mNumCallbackSamples = 0;
/* Don't need to set the VOICE_IS_AMBISONIC flag if the device is not