fix: ignore unordered frames (#11283)

This commit is contained in:
jrandolf 2023-10-31 12:39:16 +01:00 committed by GitHub
parent be0dad4114
commit ce4e485d1b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -177,7 +177,9 @@ export class ScreenRecorder extends PassThrough {
concatMap(([{timestamp: previousTimestamp, buffer}, {timestamp}]) => {
return from(
Array<Buffer>(
Math.round(DEFAULT_FPS * (timestamp - previousTimestamp))
Math.round(
DEFAULT_FPS * Math.max(timestamp - previousTimestamp, 0)
)
).fill(buffer)
);
}),