From d4e01a181837592d7a86bab9f8b24b4f3467f90e Mon Sep 17 00:00:00 2001 From: Chris Robinson Date: Mon, 17 Feb 2020 17:34:17 -0800 Subject: [PATCH] Flag the voice as callback-based when given a callback buffer --- al/source.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) 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