Skip to content
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

frontend: Only emit frontend events for existing scene collection #11897

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

PatTheMav
Copy link
Member

Description

Change emission of frontend events for scene collection and scene changes during startup only for existing scenes.

Motivation and Context

To emit frontend events early during OBS' initialisation, the disableSaving state variable needs to be "falsy" (as events will not be emitted otherwise).

The code path taken for generating a new fallback scene collection has disableSaving decremented to "enable" saving (and thus frontend events) already, so it's just the code paths for existing collections that need this workaround.

Emitting the "scene changed" and "preview scene changed" events when a fallback scene collection has been created has side-effects when OBS Studio is set to studio mode and can lead to potential crashes, as the studio mode is still in an invalid state at this point.

How Has This Been Tested?

Tested by launching OBS with studio mode active but without the configured scene collection available.

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.

To emit frontend events early during OBS' initialization, the
disableSaving state variable needs to be "falsy" (as events will not be
emitted otherwise).

The code path taken for generating a new fallback scene collection
has disableSaving decremented to "enable" saving (and thus frontend
events) already, so it's just the code paths for existing collections
that need this workaround.

Emitting the scene changed and preview scene changed events when a
fallback scene collection has been created has side-effects when
OBS Studio is set to studio mode and can lead to potential crashes,
as the studio mode is still in an invalid state at this point.
@WizardCM WizardCM added the Bug Fix Non-breaking change which fixes an issue label Feb 26, 2025
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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants