Skip to content

Commit

Permalink
Fix: use write buffer for out of sync. File buffer will only have the…
Browse files Browse the repository at this point in the history
… bytes displyed
  • Loading branch information
kylebonnici committed Apr 8, 2024
1 parent d8b60d8 commit 8d4293e
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/globals.ts
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,14 @@ export const DataManager = () => ({
(options.writeBuffer?.getFirstWriteTime() ??
options.fileBuffer?.getFirstWriteTime() ??
0);
const simulationDelta = getTimestamp() / 1000;

const processedBytes =
options.writeBuffer?.getBytesWritten() ??
options.fileBuffer?.getSessionInBytes() ??
0;

const simulationDelta =
indexToTimestamp(processedBytes / frameSize - 1) / 1000;
if (simulationDelta > actualTimePassed) return true;

const pcAheadDelta = actualTimePassed - simulationDelta;
Expand Down

0 comments on commit 8d4293e

Please sign in to comment.