Skip to content

win-capture: Update hooked state before unhooked signal #12022

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

EZ64cool
Copy link
Contributor

@EZ64cool EZ64cool commented Apr 1, 2025

Description

Updates the stop_capture call to set capturing to false before sending the unhooked signal.

Motivation and Context

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. This is mainly an issue when enumerating all capture sources to see if any are still capturing after an unhooked signal.

How Has This Been Tested?

Tested on windows 10 x64 and it now works as expected. It's a very isolated change so easy to test.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)

Checklist:

  • My code has been run through clang-format.
  • I have read the contributing document.
  • My code is not on the master branch.
  • The code has been tested.
  • All commit messages are properly formatted and commits squashed where appropriate.
  • I have included updates to all appropriate documentation.

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.
@WizardCM WizardCM added Bug Fix Non-breaking change which fixes an issue Windows Affects Windows labels Apr 1, 2025
@RytoEX RytoEX added this to the OBS Studio 31.1 milestone Apr 28, 2025
@RytoEX RytoEX merged commit b8f7c77 into obsproject:master Apr 28, 2025
15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Fix Non-breaking change which fixes an issue Windows Affects Windows
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants