Repository navigation
fix(airplay): the remote-HLS bypass reloads when it stands on its own origin (#316) - #352
Merged
superuser404notfound merged 1 commit intoAug 9, 2026
Conversation
… origin (#316) The wireless-AirPlay route change reloads the session so the playback URL is re-resolved onto the device's LAN IP, and it excluded the nativeRemoteHLS bypass wholesale on the premise that remote HLS is already receiver-reachable. That held while the bypass could only play the origin URL. #316 gave it a second shape. With text sidecars declared at load, the bypass plays a master the engine serves from its own loopback origin, and 127.0.0.1 means nothing on a receiver. Engaging AirPlay mid-playback therefore handed the receiver an address it cannot fetch, and nothing caught it: handleRefusedAirPlayMaster wants a nativeVideoSession, which this bypass does not build, so there was no watchdog and no fallback either, just the silent park the receiver does for a manifest it will not take. Mounting the proxy while already AirPlaying was covered; the route change afterwards was not, and the comment there claiming the route-change reload re-resolves this path was describing a reload that never ran for it. So the discriminator is not the backend, it is where the playback URL points. Both edges reload, matching the loopback path: engaging swaps in the LAN IP, ending puts the session back on the loopback instead of leaving it depending on a LAN address that outlives the receiver. The reload works on this path already, it was only never started: load() seats the carryover registry before the bypass branch, so the proxy is rebuilt, and loadedURL holds the origin, not the proxy URL. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01HX5zV3Fcf7Nzq4DYGdXvQE
superuser404notfound
deleted the
fix/316-airplay-route-change-on-subtitle-proxy
branch
August 9, 2026 14:23
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
The wireless-AirPlay route change (#86, #227) reloads the session so the playback URL is re-resolved onto the device's LAN IP. It excluded the
nativeRemoteHLSbypass wholesale:on the premise stated right above it, "remote-HLS is already receiver-reachable". That was true while the bypass could only ever play the origin URL.
Why it is no longer true
#316 gave the bypass a second shape. With text sidecars declared at load, it plays a master the engine serves from its own loopback origin, and
127.0.0.1means nothing on a receiver. Engaging AirPlay mid-playback handed the receiver an address it cannot fetch.Nothing caught it downstream either:
handleRefusedAirPlayMasterrequires anativeVideoSession, which this bypass never builds, so the progress watchdog and its media-playlist fallback both sit out. The result is the silent park documented inAirPlayPlaylistDecision: no-11868, no failed item.Mounting the proxy while already AirPlaying was covered (
AetherEngine+Loading.swift:381). The route change afterwards was not, and the comment at that site claiming "the route-change reload re-enters this path and re-resolves it" was describing a reload that never ran for this path.The change
The discriminator is not the backend, it is where the session's playback URL points. That goes into
AirPlayPlaylistDecisionas a pure function, matching the existing offline-testable gates in that file:Both edges reload, matching the loopback path: engaging swaps in the LAN IP, ending puts the session back on the loopback rather than leaving it depending on a LAN address that outlives the receiver.
The reload itself already works on this path, it was only never started. Verified by reading the two preconditions it depends on:
load()seats the carryover registry at the Select external subtitles to make them appear inengine.$subtitleTracks. #88 registration point (AetherEngine.swift:2520), which runs before the bypass branch, soprepareRemoteHLSSubtitleProxysees the sidecars again and remounts the proxy.loadedURLholds the origin URL (AetherEngine.swift:2440), not the proxy URL, so the reload re-enters at the origin instead of treating the loopback master as its source.Tests
Three cases added to
AirPlayPlaylistDecisionTests, red before the change (no such member), green after. Full suite: 1658 tests, 243 suites, passing.Not covered here
The device half. This is the same boundary as #316 itself: what a receiver does with the swapped URL cannot be observed headless. The reporter's PiP/AirPlay/wired-display pass is what would confirm it.
Refs #316.
🤖 Generated with Claude Code
https://claude.ai/code/session_01HX5zV3Fcf7Nzq4DYGdXvQE