From ce4e485d1b1e9d4e223890ee0fc2475a1ad71bc3 Mon Sep 17 00:00:00 2001 From: jrandolf <101637635+jrandolf@users.noreply.github.com> Date: Tue, 31 Oct 2023 12:39:16 +0100 Subject: [PATCH] fix: ignore unordered frames (#11283) --- packages/puppeteer-core/src/node/ScreenRecorder.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/puppeteer-core/src/node/ScreenRecorder.ts b/packages/puppeteer-core/src/node/ScreenRecorder.ts index ad284612d3b..4096d1ca48f 100644 --- a/packages/puppeteer-core/src/node/ScreenRecorder.ts +++ b/packages/puppeteer-core/src/node/ScreenRecorder.ts @@ -177,7 +177,9 @@ export class ScreenRecorder extends PassThrough { concatMap(([{timestamp: previousTimestamp, buffer}, {timestamp}]) => { return from( Array( - Math.round(DEFAULT_FPS * (timestamp - previousTimestamp)) + Math.round( + DEFAULT_FPS * Math.max(timestamp - previousTimestamp, 0) + ) ).fill(buffer) ); }),