fix(remote-hls): give the bypass a terminal state and act on a settled carriage verdict (#334) - #335
Merged
superuser404notfound merged 1 commit intoAug 8, 2026
Conversation
…d carriage verdict (#334) A nativeRemoteHLS session whose item never reaches readyToPlay had no way out. The lean bypass deliberately runs without a readiness watchdog and leaves a dead upstream to AVPlayer's own "gave up" signal, which covers an origin that stops answering. It does not cover one that answers everything while AVFoundation can build no track from what it serves: nothing fails, nothing becomes ready, and state stays .loading for as long as the host leaves it there. The carriage machinery could not rescue it either, because all of it hangs off the same anchor. The #293 probe settled hevcInMPEGTS from the playlists and the verdict was then read only by a loop that arms at readyToPlay, and the deferred segment-head probe waited out its 20 s readiness ceiling and returned without reading the one thing that could have judged the source. Three changes. A settled verdict now reroutes on its own: it is read off the source's own playlists or PMT, needs no grace, and a video track that does exist still outranks it. The deferred probe reads the segment head when the ceiling expires, since a mount that has not settled in 20 s is not competing with it for anything. And the bypass gets a ceiling on silence: 45 s with no readiness, no reroute and no failure publishes a real error instead of an endless spinner. Readiness at any point, a reroute, or an AVPlayer failure disarm it, so the budget is only ever spent by a session that was going to hang. Verified against a synthetic live master carrying HEVC in MPEG-TS with no audio track, the shape that produced the hang: with CODECS present it now reroutes about a second in and plays; with CODECS absent the deferred probe reads the segment head at the ceiling and reroutes at ~20 s; and a master that advertises avc1 while carrying HEVC, which nothing can judge, ends in a terminal error at 45 s instead of loading forever. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01HX5zV3Fcf7Nzq4DYGdXvQE
superuser404notfound
deleted the
fix/issue-334-bypass-readiness-terminal-state
branch
August 8, 2026 03:36
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.
Re #334. Found while verifying #321 against a synthetic live master.
A
nativeRemoteHLSsession whose item never reachesreadyToPlayhad no way out. The lean bypass runs without a readiness watchdog on purpose and leaves a dead upstream to AVPlayer's own "gave up" signal, which covers an origin that stops answering. It does not cover one that answers everything while AVFoundation builds no track from what it serves: nothing fails, nothing becomes ready,statestays.loading.The carriage machinery could not rescue it, because all of it hangs off the same anchor: the #293 probe settled
hevcInMPEGTSand the verdict was then only read by a loop that arms atreadyToPlay, and the deferred segment-head probe waited out its 20 s readiness ceiling and returned without reading the one thing that could judge the source.Three changes
Verification
12 new tests (verdict-acts-without-readiness table, deadline table), 1618 tests in 240 suites green,
-strict-concurrency=completeclean, tvOS Simulator BUILD SUCCEEDED.Each layer was also run against a synthetic live master carrying HEVC in MPEG-TS with no audio track, which is the shape that produced the hang:
CODECS="hvc1..."state=loading, verdict logged and unusedstate=playingCODECSCODECS="avc1..."while carrying HEVC.errorat 45 sInternal surface only (
RemoteHLSReadinessDeadlineand the newload(readinessDeadline:)parameter are not public), so this is a patch-level behaviour fix: sessions that used to hang now either play or fail.🤖 Generated with Claude Code
https://claude.ai/code/session_01HX5zV3Fcf7Nzq4DYGdXvQE