From fd9f8a95dbd9a941ea9234a4806646cc1f231b69 Mon Sep 17 00:00:00 2001 From: Tom Haffenden Date: Sat, 15 Feb 2025 23:33:29 +0000 Subject: [PATCH] win-capture: Update hooked state before unhooked signal If the get_hooked procedure is called during the unhooked signal the source would still report that it's hooked because gc->capturing hasn't been updated yet. --- plugins/win-capture/game-capture.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/win-capture/game-capture.c b/plugins/win-capture/game-capture.c index e0cba57b01a5e9..5347b90f6b0431 100644 --- a/plugins/win-capture/game-capture.c +++ b/plugins/win-capture/game-capture.c @@ -356,6 +356,7 @@ static void stop_capture(struct game_capture *gc) // if it was previously capturing, send an unhooked signal if (gc->capturing) { + gc->capturing = false; signal_handler_t *sh = obs_source_get_signal_handler(gc->source); calldata_t data = {0}; calldata_set_ptr(&data, "source", gc->source); @@ -370,7 +371,6 @@ static void stop_capture(struct game_capture *gc) gc->copy_texture = NULL; gc->wait_for_target_startup = false; gc->active = false; - gc->capturing = false; if (gc->retrying) gc->retrying--;