You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
rust: Port the output stop routing in obs-output.c to obs-output #2535
Rust port, round 9 unit 4: the output stop and end-capture routing in libobs/obs-output.c.h, moved to obs-output.
Scope
Rust takes over these decisions:
obs_output_stop: the delayed stop of an encoded output with a delay running;
end_data_capture_thread: the encoded or raw stop, which encoder callback is released (process_delay, interleaved or default; the interleave test reuses obs_output_raw_audio_interleave), which encoders or raw connections stop by flag, the service deactivation and the delay cleanup;
stop_raw_audio: which mixes are disconnected with raw_audio2 (reusing obs_output_raw_audio_mix_on; the first mixer is already obs_output_first_mixer);
obs_output_end_data_capture_internal: the unstarted-encoder shutdown for an encoded output, whether restart refs keep the delay, the frame log for video outputs, and the thread-creation fallback (both threads).
C keeps every atomic load and store where it is today (active, data_active, reconnecting, delay_active, delay_capturing, delay_restart_refs, end_data_capture_thread_active) and the stopping event, so each is tested in its current && order; also the joins and pthread_create (their results passed in), the unpause, info.stop, obs_output_end_data_capture, obs_output_delay_stop, obs_encoder_stop, stop_raw_video, audio_output_disconnect, obs_service_deactivate, obs_output_cleanup_delay, log_frame_info, the caption frees, the keyframe tracking clear, the stop params copied before the threads start, and every signal and log. obs_output_force_stop, obs_output_actual_stop and obs_output_signal_stop's non-reconnect branch decide only on single atomics, so they stay as they are; the reconnect policy stays C.
Fixed by PR #2536 (merged through the merge queue): the output stop and end-capture decisions of libobs/obs-output.c.h now live in rust/obs-output (module output_stop), reached through seven hidden C shims in the new libobs.ported-output-stop group, with Tier 1, Tier 2, Tier 3 and a mutation check.
What is left: nothing in this unit's scope. Every atomic load and store, join, thread creation, signal and log stays C where it was. The plan's larger route functions (stop_route, end_route and the like) were deliberately not built, because they would have moved reads of reconnecting, delay_active and active_delay_ns that other threads write; obs_output_force_stop(), obs_output_actual_stop() and obs_output_signal_stop()'s stop branch decide on single atomics and stay C. The reconnect policy stays C too.
Follow-up issue: none filed, since nothing remains to port here. The upstream behaviours the PR characterizes but does not endorse (a negative restart count keeping the delay, a forced stop of an inactive output still calling info.stop) are listed in the PR description.
Activity
rdoupe commentedon Oct 26, 2026
Claiming: #2535.
Draft PR once the RED commit exists, within the day.
libobs: Move the output stop decisions
test: Characterize the output stop decisions
obs-output: Add Tier 1 tests for output stop
obs-output: Port the output stop decisions
obs-output: Check the output stop against C
docs: Record the output stop port
rdoupe commentedon Oct 27, 2026
Fixed by PR #2536 (merged through the merge queue): the output stop and end-capture decisions of
libobs/obs-output.c.hnow live inrust/obs-output(moduleoutput_stop), reached through seven hidden C shims in the newlibobs.ported-output-stopgroup, with Tier 1, Tier 2, Tier 3 and a mutation check.What is left: nothing in this unit's scope. Every atomic load and store, join, thread creation, signal and log stays C where it was. The plan's larger route functions (
stop_route,end_routeand the like) were deliberately not built, because they would have moved reads ofreconnecting,delay_activeandactive_delay_nsthat other threads write;obs_output_force_stop(),obs_output_actual_stop()andobs_output_signal_stop()'s stop branch decide on single atomics and stay C. The reconnect policy stays C too.Follow-up issue: none filed, since nothing remains to port here. The upstream behaviours the PR characterizes but does not endorse (a negative restart count keeping the delay, a forced stop of an inactive output still calling
info.stop) are listed in the PR description.obs-output: Port the output stop decisions (obs-rust#2536)