Repository navigation
fix(slideshow): publish current_index after the transition starts (#3789) - #3909
Merged
Merged
Conversation
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]>
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.
Fixes #3789
Cause
In the legacy slideshow with slides past the 400 MiB cap,
ss_next_slide/ss_previous_slidesetcur_item(which thecurrent_indexprocedure reports) beforerun_transition()waits for the on-demand slide's decode (ready_slide) and callsobs_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 whatfade_has_both_slideshit 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_indexreads a separatepublished_item. Next and Previous only choosecur_item, andrun_transition()publishes the index after the transition has started. Resets and restarts still publish immediately throughss_set_current_index. No public header and no existing C test assertion changed.Test
New case
index_follows_transition_startintest/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 pollscurrent_indexwithout sleeping and asserts the transition already shows that slide.index 0 -> 1: transition -1 -> 0, soindex_follows_transition_startFAILED.fade_has_both_slidesalso FAILED in the same run.test_slideshow_mem_capPassed (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../lintpasses.The features ledger gets one line.
🤖 Generated with Claude Code