Skip to content

fix(slideshow): publish current_index after the transition starts (#3789) - #3909

Merged
zackees merged 2 commits into
masterfrom
agent/bug-3789
Nov 8, 2026
Merged

zackees merged 2 commits into
masterfrom
agent/bug-3789

Conversation

@zackees

@zackees zackees commented Nov 7, 2026

Copy link
Copy Markdown
Member

Fixes #3789

Cause

In the legacy slideshow with slides past the 400 MiB cap, ss_next_slide/ss_previous_slide set cur_item (which the current_index procedure reports) before run_transition() waits for the on-demand slide's decode (ready_slide) and calls obs_transition_start. During that wait a caller sees the new index while the transition still shows the previous pair at t=1. That is exactly what fade_has_both_slides hit under ASan (fade 6 -> 7 at 1.00). In upstream there is no decode between choosing the index and starting the transition, so an observer never sees one without the other.

Fix

plugins/image-source/obs-slideshow.c.h: current_index reads a separate published_item. Next and Previous only choose cur_item, and run_transition() publishes the index after the transition has started. Resets and restarts still publish immediately through ss_set_current_index. No public header and no existing C test assertion changed.

Test

New case index_follows_transition_start in test/cmocka/test_slideshow_mem_cap.c. It uses a 50 ms fade, so the next slide past the cap is still decoding when Next arrives. It polls current_index without sleeping and asserts the transition already shows that slide.

  • RED (commit 1cc3596, fix absent): index 0 -> 1: transition -1 -> 0, so index_follows_transition_start FAILED. fade_has_both_slides also FAILED in the same run.
  • GREEN (with the fix): test_slideshow_mem_cap Passed (67 s), all five cases.

Run with uv run rust/tools/linux-validate/run.py --repeat 1 --tests '^test_slideshow_mem_cap$'. That still ran the whole Tier 2 suite. Unrelated timing tests failed on the loaded host in both runs (deinterlace field order, async audio, ws monitor-only, a FLAC seek), and nothing in this change reaches them. ./lint passes.

The features ledger gets one line.

🤖 Generated with Claude Code

zackees and others added 2 commits November 7, 2026 04:27
RED: Next publishes current_index before an on-demand slide's decode
finishes and its transition starts.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
)

GREEN: Next and Previous chose the new slide and published it through the
current_index procedure before run_transition() waited for an on-demand
slide's decode and started its transition. A caller could see the new
index while the transition still showed the previous pair at t=1, as
fade_has_both_slides did under ASan. The procedure now reports an index
the transition already shows; resets still publish immediately.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@zackees
zackees added this pull request to the merge queue Nov 8, 2026
Merged via the queue into master with commit 8258b75 Nov 8, 2026
43 of 45 checks passed
@zackees
zackees deleted the agent/bug-3789 branch November 8, 2026 23:40
@obs-rust-project-manager obs-rust-project-manager Bot moved this from Needs fix to Done in obs-rust Multiview Nov 9, 2026
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: slideshow: ASan fade_has_both_slides observes completed transition

1 participant