Skip to content

Commit

Permalink
Fix audio-file for offline use
Browse files Browse the repository at this point in the history
Signed-off-by: falkTX <[email protected]>
  • Loading branch information
falkTX committed Nov 12, 2023
1 parent c1352d5 commit 88b600d
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions source/native-plugins/audio-file.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 88b600d

Please sign in to comment.