Repository navigation
fix(native): the media fallback comes back where the refused item was placed (#98) - #621
Merged
superuser404notfound merged 1 commit intoSep 24, 2026
Conversation
… placed (superuser404notfound#98) The superuser404notfound#98 media fallback replayed the start position of the session's first mount. The superuser404notfound#93/superuser404notfound#65 stage-2 recovery swaps a fresh item in at the position playback held, so when that recovery item was refused at startup, the fallback rewound the session to wherever it had first been loaded. Field log, Apple TV 4K 3rd gen, tvOS 27.0, HDR10+ HEVC Matroska opened with a resume at 1844 s: paused at 2099.69 s, the item died behind the screensaver, the recovery item was refused with -11868, and playback resumed at 1834.79 s. A title started from its beginning resumes at its first frame. NativeAVPlayerHost now records where each mount places its item, in-place swaps included, and the fallback reads that instead of the engine's first-mount copy. The first mount records the same value as before, so a fallback of a first mount is unchanged.
superuser404notfound
merged commit Sep 24, 2026
4d7c60d
into
superuser404notfound:main
7 checks passed
Owner
|
Merged, thank you. The fix is in the right place: recording the placement on the host covers every mount, the recovery swaps included, so the fallback stays on the same axis as the item it replaces without the engine having to track it separately. The field log and the before/after device run made this easy to verify. It will ship with the next engine release. The pause-guard bypass you point out (stage-2 recovery and the fallback both calling play() on a paused session behind the screensaver) is a fair separate question and is noted. |
Owner
|
Released in 7.16.1 ( |
4 tasks done
Rhainland
pushed a commit
to Rhainland/AetherEngine
that referenced
this pull request
Oct 9, 2026
Takes upstream main through dd1d5f8: 7.14.0 to 7.28.3 plus the unreleased transport, audio-selection and subtitle-delay changes. Retired fork changes, now covered upstream: - In-place handover (dfe11a0, 745de1c): upstream superuser404notfound#483, already in the merge base. - Media fallback position (a48b2bb): upstream superuser404notfound#621. - Item-death and media-fallback pause handling (fork Silo-Server#10, Silo-Server#11): upstream superuser404notfound#623's play intent. The fork's AVPlayer rate stamps are removed. A Play or Pause pressed in iOS PiP while an item dies is no longer counted. Kept, and fitted onto upstream's code: - Refreshable HTTPRequestAuthorization on upstream's sealed relay and CredentialScope. Static headers follow upstream's anchor scoping. Resolver output stays the host's per-URL decision. - Bounded resource fetches use upstream's held-body limit, and the resolver preflight keeps the 2 MB playlist cap. - Native subtitle 503 while extraction is pending, nativeTimelineOffsetSeconds, ASS for local primary rendering, and sidecar decode off the cooperative pool. - 16-thread software decode cap; TrueHD Atmos to APAC. New: - The premature-end recovery keeps a pause made during its re-seek. - An overlay-drawn injected ASS track keeps its rendition selected behind a suppressing legible output, so AE#616 keeps measuring sourceTime. - The APAC bridge reports an object decoder that produces nothing (AE#641). Co-Authored-By: Claude Opus 5.5 (1M context) <[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.
What goes wrong
When AVPlayer refuses the served master (
-11868/-11848/-1002),fallBackToMediaPlaylistreloads the media playlist atlastNativeVideoStartPosition. That value is written once, by the session's first mount inloadNative.The #93/#65 stage-2 recovery (
reloadStalledConsumerItem) swaps a fresh item in withhost.swapItem(startPosition: anchor)at the position playback held, but does not update that value. So when the recovery item is the one refused at startup, the fallback rewinds the session to wherever it was first loaded. A title started from its beginning goes back to its first frame.Field log
Apple TV 4K (3rd gen), tvOS 27.0, HDR10+ HEVC Matroska, loopback HLS, opened with a resume at 1844 s:
The item died behind the screensaver while paused, the recovery put a new item at 2099.69 s, and the fallback for that item came back at 1844 s, four minutes behind the pause.
The change
NativeAVPlayerHostrecordsmountedStartPositionon every mount, in-place swaps included: the start seekloadmakes, ornilfor a live rejoin, which makes none.fallBackToMediaPlaylistreloads VOD at the host'smountedStartPosition, i.e. where the refused item was placed.lastNativeVideoStartPositionis removed; the fallback was its only reader.The fallback now replays exactly the start position the host last mounted with, so it stays on the same axis as that mount by construction. For a session's first mount the recorded value is the same as before (
startPosition ?? 0), so the ordinary startup refusal is unchanged. Live is unchanged: it still rejoins at the edge and ignores the position.Not changed
Both the stage-2 recovery and the fallback call
host.play()even when the viewer had paused (the recovery log says "pause guard bypassed"). That can start playback behind a screensaver. It is a separate question from where the session comes back, so it is left out of this PR.Tests
MasterFallbackPositionTests(inMasterFallbackDecisionTests.swift, next to the #98 decision tests):swift teston macOS, rebased on079d74b9(7.15.2 prep): 3392 Swift Testing tests in 459 suites and 629 XCTest tests (1 skipped) pass.Test plan
-11868as the screensaver takes the display, the stage-2 recovery item is refused, and the media fallback runs.🤖 Generated with Claude Code