Repository navigation
requesthandler: Report a missing program or preview scene as null - #17
Merged
Merged
Conversation
In studio mode the frontend keeps the program scene as a weak
reference. Once that scene is removed, obs_frontend_get_current_scene()
returns NULL, and GetCurrentProgramScene put the NULL name into a json
string: std::logic_error ("basic_string: construction from null is not
valid") on the websocket thread, and OBS aborted (upstream
obsproject/obs-websocket#1349, reported by stevets).
GetCurrentProgramScene now answers with null names and UUIDs when there
is no program scene, as GetSceneList already does. GetCurrentPreviewScene
gets the same check. Nothing changes while the scene exists.
Port of obsproject/obs-websocket#1353 by andrewsoncha (program scene),
extended to the preview scene.
Refs obs-rust/obs-studio#1254.
Co-Authored-By: andrewsoncha <65234283+andrewsoncha@users.noreply.github.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Member
|
Merged (rebase); fork master is now 0d663ee. Go ahead with the obs-studio submodule bump plus the protocol test for #1254. |
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.
Refs obs-rust/obs-studio#1254
What and why
GetCurrentProgramSceneaborted OBS when there was no program scene. That happens in Studio Mode after the program scene is removed (upstream obsproject/obs-websocket#1349, reported by stevets). The frontend keeps the program scene as a weak reference, soobs_frontend_get_current_scene()returns NULL once the scene is destroyed. The handler putobs_source_get_name(NULL)into a json string, which throwsstd::logic_error("basic_string: construction from null is not valid") on the websocket thread, so OBS aborts. On macOS it is a SIGSEGV instrlen.GetCurrentProgramScenenow answers Success withsceneName,sceneUuid,currentProgramSceneNameandcurrentProgramSceneUuidallnullwhen there is no program scene.GetSceneListalready reports the same state ascurrentProgramSceneName: null.GetCurrentPreviewScenehas the same unchecked shape and gets the same check.null.RED → GREEN
The test lives in obs-rust/obs-studio (
test/cmocka/test_ws_current_scene_removed.cpp, PR to follow, RED commit 727373b38 against this fork's d79d2c2): 2 of 4 cases fail (both "scene removed" cases throw), and all 4 pass with this commit, withENABLE_RUST_LIBOBSOFF and ON. In the app (master build, headless),GetCurrentProgramSceneafterRemoveSceneof the Studio Mode program scene goes from SIGABRT to{"sceneName": null, ...}, andSetCurrentProgramSceneafterwards works.AI note: Claude Code (Claude Opus 5.5) wrote the code, the test, the commit messages and this text under the submitter's direction, and ran the tests above on the submitter's machines.
🤖 Generated with Claude Code