Repository navigation
fix(native): reset the master-fallback single-shot across session-preserving reloads - #852
Merged
superuser404notfound merged 3 commits intoOct 24, 2026
Conversation
…serving reloads (superuser404notfound#849) The reactive master→media fallback's single-shot latch (masterFallbackUsed) reset only in load()'s prologue, which the session-preserving rebuilds (reloadWithAudioOverride, reloadAtCurrentPosition) never pass through. A fallback spent on the outgoing session's master — a DV P8.1 source's one -11868 + media fallback at mount — leaked into the reload, whose own master rejection then surfaced .masterPlaylistRejected ("Cannot open") instead of falling back to the media playlist. Reset the latch in stopInternal, the shared teardown every rebuild passes through, so the reload's fresh master gets its own single-shot. The in-place stage-2 recovery keeps the latch: it uses swapItem, not stopInternal.
Owner
|
Merged in 83fcb1f, thanks @adityabakare, that is a clean find: the single-shot was correct per session, it just was not reset for the sessions a reload builds. The diagnosis and the macOS reproduction made this a quick merge. One follow-up on main (a71c6b1): the CHANGELOG entry had landed inside the already released 7.46.0 section after the merge, so it moved to [Unreleased]; the code comment and the test suite now name #849 instead of #98 (the issue the fallback was originally built for). The fix ships with the next AetherEngine release. #849 stays open until the AC-3 switch is confirmed on that release. |
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.
Summary
A session-preserving reload (audio-track switch, reloadAtCurrentPosition) recovers from its own master rejection again. The reactive master→media fallback's single-shot latch was reset only in load()'s prologue, which the reload paths never reach, so a fallback spent on the outgoing session's master leaked into the reload and turned the reload's own rejection into a terminal .masterPlaylistRejected.
Refs #849
What changed
Sources/AetherEngine/AetherEngine.swift — reset masterFallbackUsed in stopInternal, the shared teardown every session-preserving rebuild passes through. The in-place stage-2 recovery is unaffected: it uses swapItem, not stopInternal, so it keeps the latch (preserving "the fallback reads the placement of the item it replaces").
Tests/AetherEngineTests/MasterFallbackResetTests.swift — new coverage: the latch resets across the shared teardown and re-admits the new session's -11868.
CHANGELOG.md — entry under [Unreleased].
Device / OS: Mac14,9 (Apple M2 Pro), macOS 27.0.1 (26A434), built-in Liquid Retina XDR; native .loopback route via aetherctl.
Source media: MKV, 29 GB; HEVC Main 10 3832x1600 @ 23.976, BT.2020 / PQ, HDR10 + Dolby Vision P8.1 (dvh1.08.06/db1p); audio track 1 E-AC-3 5.1 (default), track 2 AC-3 5.1. Loaded with dolbyVisionHandling: .baseLayerOnly, progressiveSegmentDelivery: true, audioBridgeMode: .surroundCompat.
Result:
Suite: swift test — 4785 tests pass, including the new MasterFallbackResetTests and the unchanged MasterFallbackPositionTests / StaleSessionCallbackTests.
Checklist
CHANGELOG.mdupdatedfeat(...),fix(...),chore(...))