Improve frame dropping under backpressure

This commit is contained in:
2026-06-11 09:47:17 -07:00
parent a9f8509b99
commit 7655d7aaba
2 changed files with 130 additions and 44 deletions

View File

@@ -657,7 +657,7 @@ function trimPendingFrameQueue() {
const overflow = state.pendingFrames.length - maxQueuedFrames;
if (overflow > 0) {
state.pendingFrames.splice(maxQueuedFrames, overflow);
state.pendingFrames.splice(0, overflow);
}
}
@@ -671,7 +671,7 @@ function trimFrameQueue() {
return;
}
const removed = state.frames.splice(maxQueuedFrames, overflow);
const removed = state.frames.splice(0, overflow);
for (const frame of removed) {
releaseImage(frame.bitmap);