Repository navigation
fix(routing): reroute remote HLS classified by the loopback session's own open (#246) - #247
Merged
Conversation
… own open (#246) The AE#154 reroute keys on AVIOReaderError.hlsPlaylistOnVODPath, which only reaches it when the load-time probe is the open that reads the playlist body. A probe that failed transiently first left probeFailure inconclusive, so the load fell through to the loopback path with no preopened demuxer, and HLSVideoEngine.start()'s fallback open produced the classification instead. That open interpolated the typed error into openFailed(reason:), erasing the domain, so a playable source failed terminally while a manual retry played. The fallback open now rethrows both HLS classifications verbatim, and load() answers one from either open with the same reroute, taken as a full load() restart (the #168 shape) so the half-built loopback session is cleared. The bypass runs no probe, so it cannot bounce back a second time. The bypass also never forwarded startPosition, which would have dropped the resume anchor on every reroute; VOD now honors it, live keeps its no-initial-seek contract. Reported by qoli. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01At1agC2qU2Y2MX2BKLdT4N
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.
Problem
The AE#154 reroute onto the native remote-HLS bypass keys on
AVIOReaderError.hlsPlaylistOnVODPath. That typed classification only reaches the check when the load-time probe is the open that reads the playlist body.When the first
probe.openfails for an unrelated (transient) reason,probeFailureis inconclusive,shouldReroutereturns false, and the load falls through to the loopback path withpreopenedDemuxer: nil.HLSVideoEngine.start()then reopens the same URL, and that open is the first to see the body, so it is the one that produceshlsPlaylistOnVODPath. The fallback open interpolated it intoHLSVideoEngineError.openFailed(reason: "\(error)"), erasing the domain, and the load died terminally withHLS playlist supplied to the VOD loopback pathfor a source AVPlayer plays fine (the reporter's manual retry, whose first probe happened to see the body, routed native and reachedreadyToPlay).Fix
HLSVideoEngine.openFailure(from:)rethrows both HLS classifications verbatim and keeps the wrappedopenFailed(reason:)shape for everything else.hlsPlaylistOnRawLivePathrides along so AE#140 stays typed at every open too.load()'s dispatchcatchanswers the classification from either open with the same AE#154 reroute. It is taken as a fullload()restart, the shape the HDR10 4K HEVC 50fps live HLS via nativeRemoteHLS: AVPlayer exposes no video track (audio-only, black); no HDR display-criteria negotiation. VLC + Android decode it fine #168 reroute already uses, because the half-built loopback session has to be cleared; the bypass runs no probe, so it cannot bounce back here a second time.RemoteHLSMediaSelection.shouldRerouteis renamedprobeFailure:->failure:since it now answers both origins. NoisLiveguard is needed: the reader only classifies ashlsPlaylistOnVODPathon the non-live path.Also fixed, because the reroute would otherwise drop the resume anchor: the
nativeRemoteHLSbranch never forwardedstartPosition, so a VOD playlist restarted at zero whether the host requested the bypass directly or arrived on it through a reroute. Live keeps its no-initial-seek contract even when a host passes an anchor.Tests
Issue246SecondOpenRerouteTestscovers the open-failure mapping and the reroute decision on the error it preserves, including the regression direction (a wrapped classification must not reroute, which is why it must not be wrapped). Full suite 1262/1262 green,-strict-concurrency=completeclean, tvOS Simulator build succeeds.Reported by qoli (#246).
🤖 Generated with Claude Code
https://claude.ai/code/session_01At1agC2qU2Y2MX2BKLdT4N