Skip to content

libobs: Keep scene item transitions in the scene's active tree - #325

Merged
zackees merged 2 commits into
obs-rust:masterfrom
rdoupe:fix/5551-group-hide-transition-audio
Oct 12, 2026
Merged

zackees merged 2 commits into
obs-rust:masterfrom
rdoupe:fix/5551-group-hide-transition-audio

Conversation

@rdoupe

@rdoupe rdoupe commented Oct 12, 2026

Copy link
Copy Markdown
Collaborator

Description

Hiding a group now deactivates children that have show/hide transitions, so a hidden VLC or Media Source stops playing instead of running on (and being heard in monitoring) while hidden.

  1. Hiding a group calls group_item_transition(), which starts each visible child's hide transition (obs_sceneitem_do_transition(child, false)). The transition holds the child source and is added as an active child of the group's scene, while the child item itself stays visible.

  2. scene_enum_sources() listed an item's hide transition only when the item was not visible, so when the group's scene was deactivated the running hide transition, and the child source inside it, were never deactivated.

  3. obs_sceneitem_do_transition() stopped a running transition with obs_transition_force_stop(), which only emits transition_stop: the transition left the scene's active children but kept its running state, and the active tree later deactivated it a second time, driving its counts to -1.

  4. test: Hiding a group must stop a child with show/hide transitions: test_group_hide_transition_audio puts a constant-tone input in a group on program, gives the child a minimal registered fade as its 300 ms show and hide transitions, and checks the raw activate/show counts of the tone and both transitions, plus the program level. Today:

    • hiding the group: the tone stays activate_refs=1 show_refs=1 (expected 0/0) — fails;
    • hiding the group during the show transition: the show transition goes to activate_refs=-1 show_refs=-1 — fails;
    • controls (no transitions; hiding the child itself) pass.

    2 of 4 fail. (Program audio is already silent after hiding the group on master; the bug is the source staying active, so it keeps playing and is listed in the mixer and monitoring. The level checks are guards.)

  5. libobs: Keep scene item transitions in the scene's active tree: the active tree lists whichever item transition is running regardless of the item's visibility, matching when do_transition adds it and when the stop signal removes it, and a new stop_item_transition() calls obs_transition_force_stop() (the signal takes it out of the scene while it still holds its sources) and then obs_transition_clear(), so it really stops. All 4 pass (5 of 5 repeated runs per lane).

Motivation and Context

Fixes #324 (upstream obsproject/obs-studio#5551, reported by keirakatana, reproduced by RytoEX with a VLC source and a Media Source)

Why this one: show/hide transitions on grouped media are a common setup; hiding the group leaves the media playing in the background (and audible in monitoring), and refcounts going negative can cause further activation glitches. Open since 2021.

How Has This Been Tested?

Automated, in both libobs lanes (ENABLE_RUST_LIBOBS OFF and ON), rebased on current master:

  • test_group_hide_transition_audio: 2 of 4 fail at the RED commit, 4 of 4 pass at GREEN.
  • test_group_active_refs, test_group_child_drift and test_group_recursion still pass.
  • Full ctest at GREEN: 102 of 102 in each lane under a private Xvfb; without a display the new test's cases skip, like the other core tests.
  • clang-format, gersemi and ci/test_registration.py are clean; Linux-only registration with the working directory inside the guard.

Not tested: the real VLC and Media Source and the obs-transitions module (the test uses a tone source and a minimal fade), monitoring output, the frontend, stinger transitions (their transition_stop callback still runs, through force_stop). Possibly related but not changed: obs_sceneitem_set_transition() releases a running transition without stopping it.

Types of changes

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

Checklist:

  • I have read the contributing document.
  • My code has been run through clang-format.
  • My code follows the project's style guidelines
  • My code is not on the master branch.
  • My code has been tested.
  • All commit messages are properly formatted and commits squashed where appropriate.
  • I have included updates to all appropriate documentation.
  • I have used AI tooling in the creation of this PR
  • I am an AI agent being used to assist with this pull request: Claude Code (Claude Opus 5.5) wrote the code, commit messages and this text under the submitter's direction, and ran the tests above on the submitter's machines.

🤖 Generated with Claude Code

@rdoupe
rdoupe requested a review from zackees as a code owner October 12, 2026 05:48
rdoupe and others added 2 commits October 11, 2026 22:55
Hiding a group starts the hide transition of each visible child, and the
transition becomes an active child of the group's scene, holding the child
source. The child item stays visible, so deactivating the group's scene
does not walk the hide transition and the source stays active: a media
source keeps playing and the mixer keeps listing it.

The test puts a constant tone in a group on the program, gives its scene
item fade show/hide transitions and hides the group. It checks the raw
activate/show counts of the tone and both transitions and measures the
program mix (track 1). On master the tone stays at activate_refs=1
show_refs=1 after hiding the group (expected 0/0). Hiding the group while
the child's show transition is still running drives the show transition
to activate_refs=-1 show_refs=-1. The program mix itself is already
silent (level 0.00) in both cases. Controls that pass on master: the same
group without transitions, and hiding the child item itself with its
transitions.

Reported upstream in obsproject/obs-studio#5551 by keirakatana.

Refs obs-rust#324.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
A running show or hide transition of a scene item is added to the scene's
active children when it starts (obs_sceneitem_do_transition) and removed
when its transition_stop signal fires. The scene's active tree only listed
it when it matched the item's visibility, so a transition that ran against
it was activated with the scene but never deactivated. Hiding a group
starts the hide transition of every visible child, whose own item stays
visible; deactivating the group's scene skipped that hide transition, so
it and the child source in it stayed active: a media source kept playing
and the mixer kept listing it. The active tree now lists whichever item
transition is running.

Starting an item transition also stopped the running one with
obs_transition_force_stop(), which only signals transition_stop: that
takes the transition out of the scene's active children but leaves it
running, so the active tree still listed it and the scene deactivated it
a second time (hiding a group during a child's show transition drove the
show transition to -1). The running transition is now cleared after the
signal, so it stops for good.

Fixes obs-rust#324.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Local-Gate: v1 tree=d82a52029edc10c97876ed10e7c5fe82dcfc3f7a secs=124 lanes=lint:run,rust-test:run,tier2-linux:run
Ci-Attestation: {"at":1791784628,"gate":"rust/all/fmt","host":"linux-x86_64","key":"83f7ad7472c436343f9ade4eb9787df0efca68f39474aaa18b4b37f6c590c46d","lane":"lint","parents":["53bd3f496ddeee66f41622177201fcda2e313234"],"secs":18,"stamp":"2eb9b616c2bd02d9c0b63d01da9c5b3f","tree":"d82a52029edc10c97876ed10e7c5fe82dcfc3f7a","v":1,"via":"run"}
Ci-Attestation: {"at":1791784628,"gate":"rust/x86_64-unknown-linux-gnu/clippy","host":"linux-x86_64","key":"83f7ad7472c436343f9ade4eb9787df0efca68f39474aaa18b4b37f6c590c46d","lane":"lint","parents":["53bd3f496ddeee66f41622177201fcda2e313234"],"secs":18,"stamp":"0d51415ec7bbf90076ec8ecaf870ad6b","tree":"d82a52029edc10c97876ed10e7c5fe82dcfc3f7a","v":1,"via":"run"}
Ci-Attestation: {"at":1791784628,"gate":"rust/x86_64-unknown-linux-gnu/test","host":"linux-x86_64","key":"376b7052a05fd7bce17e96560e30fd12836af680c7f7ba631e1dfb770807b76f","lane":"rust-test","parents":["53bd3f496ddeee66f41622177201fcda2e313234"],"secs":56,"stamp":"b269b9874f0ad66c362a1acda78fc6a8","tree":"d82a52029edc10c97876ed10e7c5fe82dcfc3f7a","v":1,"via":"run"}
Ci-Attestation: {"at":1791784628,"gate":"cpp/linux-x64/tier2","host":"linux-x86_64","key":"3017667c97fbd2a40c99398754d5fe6c718f72d789ccbd10b06690062fd6d4c7","lane":"tier2-linux","parents":["53bd3f496ddeee66f41622177201fcda2e313234"],"secs":50,"stamp":"06fd873b2e23b256e63e49d226bff51b","tree":"d82a52029edc10c97876ed10e7c5fe82dcfc3f7a","v":1,"via":"run"}
@zackees

zackees commented Oct 12, 2026

Copy link
Copy Markdown
Member

Verified locally, rebased onto master and stamped. The test needs a display, so I ran it with xvfb-run ctest plus Mesa on each commit's Tier 2 build:

  • RED (6a62f0d08): 2 of 4 passed. hide_group_with_child_transitions and hide_group_during_child_show_transition failed.
  • GREEN (fef2058d9): the test passed. Plain Tier 2 passed 104 of 104 with ENABLE_RUST_LIBOBS OFF and 104 of 104 with it ON, and the local gate passed.

Merging once CI is green.

@zackees
zackees force-pushed the fix/5551-group-hide-transition-audio branch from fef2058 to cf49dd5 Compare October 12, 2026 05:57
@zackees
zackees merged commit 81b87ec into obs-rust:master Oct 12, 2026
23 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

bug: libobs: hiding a group keeps children with show/hide transitions active (upstream #5551)

2 participants