Repository navigation
fix(native): a recovery reload leaves a paused viewer paused (#93) - #623
Conversation
…er404notfound#93) Item death parks AVPlayer at .paused whatever the viewer wanted, so the fallback then called play() on the fresh item unconditionally. Field log, Apple TV 4K 3rd gen, tvOS 27.0, HDR10+ HEVC Matroska: paused, the tvOS screensaver took the display two minutes later, the item died with -11868, and the recovery started the title and dismissed the screensaver. Both now resume only when the host's durable play intent (superuser404notfound#122), which the in-place swap keeps, says the viewer was playing. A playing viewer is resumed exactly as before.
4b881fd to
9b8e4ee
Compare
ee6a86b
into
superuser404notfound:main
…med session (#623) `aetherctl play --host-calls pausereload,playreload,extplayreload` forces the #93/#65 stage-2 item reload at t=10 on a session paused at t=6, on one left playing, and on one paused through the engine and resumed straight on the AVPlayer the way AVKit's transport does. The run fails with exit 4 if the clock moves after the paused reload or stands still after a playing one. Measured on a 90 s testsrc fixture: before #623 the paused session came back at +7.20 s, state=playing; after it holds at +0.00 s, state=paused. The AVKit-resumed case, whose engine intent still reads paused, comes back playing because the in-place swap keeps the player's rate, so #623's intent check needs no second signal. Refs #626 Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_014AVNwe8YDG9EQM7uHdjT3f
|
Merged, thank you. The device run behind a real screensaver is exactly the evidence this needed, and the engine-level tests through Follow-up on main (d49516e): |
|
Released in 7.16.1 ( |
…ng (superuser404notfound#98) When a dead item's recovery reload was refused (-11868), fallBackToMediaPlaylist swapped in the media playlist and called play() unconditionally, so a title paused behind the tvOS screensaver started itself. The item-death reload now keeps the viewer's pause (clearing the host's play intent), and the fallback reads that same intent before it plays. Ports the fallback half of upstream superuser404notfound#623; the reload half is covered by this fork's own item-death change. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
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]>
What goes wrong
Item death (
failedToPlayToEndTime) parks AVPlayer at.pausedwhatever the viewer wanted, which is why the #93 revive runs the stage-2 reload with the pause guard bypassed. That reload (reloadStalledConsumerItem) and the #98 media fallback (fallBackToMediaPlaylist) then callhost.play()on the fresh item unconditionally. So a title the viewer had paused starts itself again whenever its item dies.On tvOS this happens reliably behind the screensaver: pause an HDR title, the screensaver takes the display two minutes later, the paused item dies with
-11868, and the recovery'splay()dismisses the screensaver.Field log
Apple TV 4K (3rd gen), tvOS 27.0, HDR10+ HEVC Matroska over Jellyfin, host app Plozz. The viewer never touched the remote after pausing:
The change
Both call sites now play only when the host's durable intent (
transportIntentIsPlaying, #122) says the viewer was playing:playIntentis written only byplay(),pause(),setRate(_:)and a full (non-in-place) unload; no KVO path writes it, so AVPlayer dropping to rate 0 when its item dies leaves a playing viewer's intent intact, and the in-place swap keeps it. A playing viewer is therefore resumed exactly as before, which is what #93 exists for; only a genuinely paused one now stays paused.The other
host.play()sites (startup readiness gate, AirPlay watchdog, the stage-1 nudge, which only runs for a playing consumer) are unchanged.Tests
In
Issue93ItemDeathReviveTests.swift, next to the existing item-death tests, a@MainActorsuite drives the real stage-2 reload throughforceStalledConsumerReloadForTesting()on an engine holding a mountedNativeAVPlayerHost:Against
mainwithout the change, the paused-viewer test and the fallback test fail and the playing-viewer test passes, so the suite pins the new behaviour and guards the #93 one.swift teston macOS, rebased on4d7c60d2(with #621 merged): 3400 Swift Testing tests in 460 suites and 629 XCTest tests (1 skipped) pass.Test plan
On device, Apple TV 4K (3rd gen), tvOS 27.0, same HDR10+ HEVC Matroska over Jellyfin, Plozz built against this branch plus #621:
-11868, the stage-2 reload and the media fallback ran, and the screensaver stayed on (no foreground return); the position held at 2605.25 splay(): it reached its ownitem.status(herefailed, which drove the fallback)Related: #621 (merged) fixed where the same fallback resumes; this branch is rebased on it.
🤖 Generated with Claude Code