From 4bd45dc927448160abbcc9f75ab6a23bbf649537 Mon Sep 17 00:00:00 2001 From: webadderall <131426131+webadderall@users.noreply.github.com> Date: Wed, 8 Apr 2026 23:39:35 +1000 Subject: [PATCH] =?UTF-8?q?fix:=20cursor=20desync=20in=20exports=20?= =?UTF-8?q?=E2=80=94=20remove=20erroneous=20startup=20offset=20from=20curs?= =?UTF-8?q?or=20timestamp?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/lib/exporter/streamingDecoder.ts | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/src/lib/exporter/streamingDecoder.ts b/src/lib/exporter/streamingDecoder.ts index a7a3e177..fdcb1a0d 100644 --- a/src/lib/exporter/streamingDecoder.ts +++ b/src/lib/exporter/streamingDecoder.ts @@ -221,7 +221,6 @@ export class StreamingVideoDecoder { let decodeError: Error | null = null; let decodeDone = false; let firstDecodedFrameTimestampUs: number | null = null; - let decodedFrameStartupOffsetUs = 0; this.decoder = new VideoDecoder({ output: (frame: VideoFrame) => { @@ -349,12 +348,11 @@ export class StreamingVideoDecoder { const clone = new VideoFrame(heldFrame, { timestamp: heldFrame.timestamp }); const sourceTimestampMs = sourceTimeSec * 1000; - const cursorTimestampMs = sourceTimestampMs + decodedFrameStartupOffsetUs / 1000; await onFrame( clone, exportFrameIndex * frameDurationUs, sourceTimestampMs, - cursorTimestampMs, + sourceTimestampMs, ); segmentFrameIndex++; exportFrameIndex++; @@ -367,10 +365,6 @@ export class StreamingVideoDecoder { if (firstDecodedFrameTimestampUs === null) { firstDecodedFrameTimestampUs = frame.timestamp; - decodedFrameStartupOffsetUs = getDecodedFrameStartupOffsetUs( - firstDecodedFrameTimestampUs, - this.metadata, - ); } const normalizedFrameTimeSec = Math.max( @@ -444,12 +438,11 @@ export class StreamingVideoDecoder { const clone = new VideoFrame(heldFrame, { timestamp: heldFrame.timestamp }); const sourceTimestampMs = sourceTimeSec * 1000; - const cursorTimestampMs = sourceTimestampMs + decodedFrameStartupOffsetUs / 1000; await onFrame( clone, exportFrameIndex * frameDurationUs, sourceTimestampMs, - cursorTimestampMs, + sourceTimestampMs, ); segmentFrameIndex++; exportFrameIndex++;