From 713b63bb495e200d0b79e1bf7e8caf0f80a2a110 Mon Sep 17 00:00:00 2001 From: "J.S.Patrick" <980141374@qq.com> Date: Thu, 30 Jul 2026 15:12:03 +0800 Subject: [PATCH] =?UTF-8?q?perf:=20=E9=A2=84=E6=8A=93=E5=B8=A7=E6=9C=89?= =?UTF-8?q?=E6=95=88=E6=9C=9F=E6=94=BE=E5=AE=BD=E8=87=B3=202s?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 将 SC_PRIMED_FRAME_TTL 从 500ms 调整为 2s,降低机器繁忙或选区流程启动较慢时预帧过期回退实时抓帧的概率,同时保留过期保护避免使用陈旧帧。 --- src/screenshot_windows.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/screenshot_windows.cpp b/src/screenshot_windows.cpp index 39012e3..a8d0639 100644 --- a/src/screenshot_windows.cpp +++ b/src/screenshot_windows.cpp @@ -51,7 +51,7 @@ static std::thread g_screenshotThread; // 由 startRegionCaptureWithPrimedFrame 的 options.autoConfirm 设置, // 会话开始时拷贝进 CaptureContext 供窗口过程读取。 static std::atomic g_autoConfirm(false); -static const auto SC_PRIMED_FRAME_TTL = std::chrono::milliseconds(500); +static const auto SC_PRIMED_FRAME_TTL = std::chrono::seconds(2); struct PrimedScreenshotFrame { HBITMAP bitmap = NULL;