diff options
author | Chris Robinson <[email protected]> | 2023-03-28 23:27:03 -0700 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2023-03-28 23:27:03 -0700 |
commit | 0b3dde9ccc9eaf82f1cceac234ab7bed0d4061e6 (patch) | |
tree | fc88c4b54b2dda87ef59629bfe382cc2a96fced7 /al | |
parent | ac01cbf7a518df913b3c9e45565a4ab7a8653bc7 (diff) |
Allow using a negative offset with callback buffers
Diffstat (limited to 'al')
-rw-r--r-- | al/source.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/al/source.cpp b/al/source.cpp index f49d0a20..cba33862 100644 --- a/al/source.cpp +++ b/al/source.cpp @@ -405,7 +405,7 @@ al::optional<VoicePos> GetSampleOffset(al::deque<ALbufferQueueItem> &BufferList, BufferFmt = item.mBuffer; if(BufferFmt) break; } - if(!BufferFmt || BufferFmt->mCallback) + if(!BufferFmt) UNLIKELY return al::nullopt; /* Get sample frame offset */ @@ -456,6 +456,9 @@ al::optional<VoicePos> GetSampleOffset(al::deque<ALbufferQueueItem> &BufferList, return VoicePos{static_cast<int>(offset), frac, &BufferList.front()}; } + if(BufferFmt->mCallback) + return al::nullopt; + int64_t totalBufferLen{0}; for(auto &item : BufferList) { |