scrap: release the frame through the state machine when abandoning the tone-map

master's FrameState machine is left at Acquired by the raw ReleaseFrame(),
so the next release_frame() hits DXGI_ERROR_INVALID_CALL on the fresh
duplication and the capture loop falls back to GDI -- the outcome the
fallback exists to avoid.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
rustdesk
2026-09-23 18:03:36 +08:00
co-authored by Claude Fable 5.1
parent ef65cf017c
commit e877da5872
+3 -1
View File
@@ -264,7 +264,9 @@ impl Capturer {
}
hbb_common::log::error!("HDR tone-map failed, re-duplicating without it: {err}");
self.hdr = None;
(*self.duplication.0).ReleaseFrame();
if let Err(release_err) = self.release_frame() {
hbb_common::log::warn!("DXGI frame cleanup failed while disabling HDR: {release_err}");
}
self.duplication = ComPtr(ptr::null_mut());
let mut duplication = ptr::null_mut();
let result = wrap_hresult(