Repository navigation
frontend-tools: Reset the Output Timer after its timer ends while closed - #601
Merged
Merged
Conversation
Builds the real Output Timer dialog on Qt's offscreen platform against stubs of the frontend API. With "Enable ... timer every time" on and the dialog closed, the timer stops the recording or stream, but the dialog still shows Stop (checked) when it is opened again; clicking that Stop starts a new recording. Two guards: the dialog open, and a recording stopped by hand while the dialog is closed (its timer must not fire later). Refs obs-rust#600. Co-Authored-By: Claude Opus 5.5 <[email protected]>
StreamTimerStop() and RecordTimerStop() returned early when the dialog was hidden and the timer was no longer running. That is exactly the state after the timer itself stopped the output, so the button kept saying Stop (checked) and the countdown kept updating. Opened later, the dialog offered Stop for an output that was not running, and clicking it started a new one. Always reset the button and the countdown when the output stops; nothing in them depends on the dialog being visible. Fixes obs-rust#600. Co-Authored-By: Claude Opus 5.5 <[email protected]>
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
Tools > Output Timer now goes back to "Start" when its timer stops a recording or a stream while the dialog is closed. Before, it kept showing "Stop" (checked), and clicking that "Stop" later started a new recording.
RecordTimerStop()andStreamTimerStop()returned early when the dialog was hidden and the timer was no longer running. That is exactly the state after the single-shot timer itself stopped the output, so the button and the countdown were never reset. Stopping a paused recording (with "Pause timer when recording is paused") while the dialog was closed did the same.test/cmocka: Output Timer keeps Stop after its timer ends while closed:test_output_timerbuilds the real dialog (output-timer.cppand its.ui) on Qt's offscreen platform against stubs of the frontend API that behave like the frontend (start sends STARTED, stop sends STOPPING), with a 1 s timer and "Enable ... timer every time" checked. The cases are:2 of 4 fail today (the guards pass), the same way in every run.
frontend-tools: Reset the Output Timer after its timer ends while closed: the fix. 4 of 4 pass.Motivation and Context
Fixes #600 (upstream obsproject/obs-studio#10900, reported by ShaMAD, who also pointed out the same code in the streaming timer). Sugam-Chand-M found the cause in obsproject/obs-studio#10937 (not merged); that change flips the condition so the stop returns while the timer is still running, which keeps a timer alive after a recording stopped by hand with the dialog closed and then stops the next recording. The last guard case covers that.
Reproduced in the current release (AppImage 33.0.0-beta6-799), headless, with a small test module that sets a 2 s recording timer with "Enable recording timer every time" and reads the dialog:
Why this one: a button that does the opposite of its label and starts an unwanted recording; clearly a bug, reported by a user with a video, two-line fix, reproduced in our release.
How Has This Been Tested?
Automated, in both libobs lanes (
ENABLE_RUST_LIBOBSOFF and ON), rebased on current master:test_output_timer: 2 of 4 cases fail at the RED commit and 4 of 4 pass at GREEN (3 runs each per lane). It needs Qt Widgets (the offscreen platform plugin ships with Qt's GUI library) but no display and no frontend build;ctest -Vshows all 4 cases run.open_crashes_without_obs_coreskips).End to end with the fix (OBS built from this branch with the frontend, Rust libobs, headless, same test module): with the dialog closed the timer stops the recording after 2 s and the dialog shows "Start" (unchecked); opened, it offers Start, and clicking it starts a recording as labelled. With the dialog open it behaves as before.
Not tested by hand: streaming (needs a server); the test covers the streaming timer, which runs the same code.
Types of changes
Checklist:
🤖 Generated with Claude Code