Skip to content

frontend-tools: Reset the Output Timer after its timer ends while closed - #601

Merged
zackees merged 2 commits into
obs-rust:masterfrom
rdoupe:fix/output-timer-hidden
Oct 13, 2026
Merged

zackees merged 2 commits into
obs-rust:masterfrom
rdoupe:fix/output-timer-hidden

Conversation

@rdoupe

@rdoupe rdoupe commented Oct 13, 2026

Copy link
Copy Markdown
Collaborator

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() and StreamTimerStop() 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.
  • They now always reset the button and the countdown when the output stops; nothing there depends on the dialog being visible.
  1. test/cmocka: Output Timer keeps Stop after its timer ends while closed: test_output_timer builds the real dialog (output-timer.cpp and 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:

    • the recording timer ends while the dialog is closed: the reopened dialog must offer Start;
    • the streaming timer, the same;
    • guard: the recording timer ends with the dialog open;
    • guard: a recording stopped by hand while the dialog is closed cancels its timer, so it does not stop anything later.

    2 of 4 fail today (the guards pass), the same way in every run.

  2. 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:

  • dialog closed, recording started: the timer stops it after 2 s, the dialog still shows "Stop" (checked);
  • dialog opened and the button clicked: a new recording starts ("Starting recording due to OutputTimer");
  • control, same with the dialog open: the button is back to "Start".

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_LIBOBS OFF 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 -V shows all 4 cases run.
  • Full ctest at GREEN, rebased on current master: 177 of 177 in each lane, with every PipeWire and PulseAudio test actually run (TMPDIR unset; only the known open_crashes_without_obs_core skips).
  • clang-format and gersemi are clean.

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

  • 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 and others added 2 commits October 13, 2026 13:17
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]>
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: frontend-tools: Output Timer still shows Stop after its timer stopped the output while the dialog was closed (upstream obsproject/obs-studio#10900)

2 participants