From 88b600d6e2ad3bfd12747e8ddde031e40fc79a1f Mon Sep 17 00:00:00 2001 From: falkTX Date: Sun, 12 Nov 2023 10:47:47 +0200 Subject: [PATCH] Fix audio-file for offline use Signed-off-by: falkTX --- source/native-plugins/audio-file.cpp | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/source/native-plugins/audio-file.cpp b/source/native-plugins/audio-file.cpp index 4d37ffb6ee..822ccdb61e 100644 --- a/source/native-plugins/audio-file.cpp +++ b/source/native-plugins/audio-file.cpp @@ -449,12 +449,21 @@ class AudioFilePlugin : public NativePluginClass return; } + const bool offline = isOffline(); bool needsIdleRequest = false; - if (fReader.tickFrames(outBuffer, 0, frames, framePos, fLoopMode, isOffline()) && ! fPendingFileRead) + if (fReader.tickFrames(outBuffer, 0, frames, framePos, fLoopMode, offline) && ! fPendingFileRead) { - fPendingFileRead = true; - needsIdleRequest = true; + if (offline) + { + fPendingFileRead = false; + fReader.readPoll(); + } + else + { + fPendingFileRead = true; + needsIdleRequest = true; + } } fLastPosition = fReader.getLastPlayPosition() * 100.f;