Repository navigation
libobs: Keep scene item transitions in the scene's active tree - #325
Merged
zackees merged 2 commits intoOct 12, 2026
Merged
Conversation
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"}
Member
|
Verified locally, rebased onto master and stamped. The test needs a display, so I ran it with
Merging once CI is green. |
zackees
force-pushed
the
fix/5551-group-hide-transition-audio
branch
from
October 12, 2026 05:57
fef2058 to
cf49dd5
Compare
This was referenced Oct 12, 2026
Closed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.
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 staysvisible.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.obs_sceneitem_do_transition()stopped a running transition withobs_transition_force_stop(), which only emitstransition_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.test: Hiding a group must stop a child with show/hide transitions:test_group_hide_transition_audioputs 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:activate_refs=1 show_refs=1(expected 0/0) — fails;activate_refs=-1 show_refs=-1— fails;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.)
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 whendo_transitionadds it and when the stop signal removes it, and a newstop_item_transition()callsobs_transition_force_stop()(the signal takes it out of the scene while it still holds its sources) and thenobs_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_LIBOBSOFF 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_driftandtest_group_recursionstill pass.ci/test_registration.pyare 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_stopcallback still runs, throughforce_stop). Possibly related but not changed:obs_sceneitem_set_transition()releases a running transition without stopping it.Types of changes
Checklist:
🤖 Generated with Claude Code