Skip to content

Commit

Permalink
game-capture: Update hooked state before unhooked
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
EZ64cool committed Mar 30, 2024
1 parent 004253f commit 00d1751
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion plugins/win-capture/game-capture.c
Original file line number Diff line number Diff line change
Expand Up @@ -374,6 +374,8 @@ 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};
Expand All @@ -389,7 +391,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--;
Expand Down

0 comments on commit 00d1751

Please sign in to comment.