Repository navigation
Cast: pick audio and subtitle tracks on the TV; release 0.2.0 - #17
Merged
Merged
Conversation
While casting a movie or episode, the player's Audio and Subtitles menus (and the A/S keys) now work on the TV, and casting starts with the tracks playing here. Relay (remux.c, relay.rs) - The remuxer streams the asked audio stream (falling back to player.audioLang) and reports every audio/subtitle stream before the first packet. - One text subtitle stream (SubRip, ASS, mov_text, WebVTT) is decoded on the way: the asked one, else by player.subLang, else the file's default. Only that stream is read, so MP4 inputs don't seek for the others. - The relay serves /cast/<token>/<n>.vtt next to <n>.mp4: WebVTT cues of that stream as they are decoded, on the receiver's clock. ASS styling is reduced to italic/bold/underline. A repeated request for the same URL takes over the cue feed instead of ending it. - Picture subtitles (PGS, DVD) and live channels get no subtitles. Session (session.rs) - Every non-live LOAD offers the .vtt as a text track and switches it on with EDIT_TRACKS_INFO once the TV plays (not at LOAD: a track that never finishes loading may hold up playback), ignoring late statuses of the previous media session. - The Default Media Receiver can't switch in-band audio, so a track change reloads the item where it is, staying paused when it was. - Status carries the item's tracks and which are playing (tracksKnown, audioTracks, subtitleTracks, audio, subtitle); cast_control takes audio/subtitle, cast_play takes the starting tracks. Frontend - castProps maps the TV's tracks onto the mpv-shaped props (ids = stream index = mpv ff-index); control.setTrack/cycleAudio work while casting; castTracksFrom hands the current tracks over on castTo (also when switching TVs). - The track menus show "Waiting for the TV…" until the tracks are known, "Not on TV" for picture subtitles, and the live-channel note. Tests: auto-language and ASS→WebVTT/cue-timing unit tests, castProps and castTracksFrom tests, and an ignored end-to-end relay test (TP_CAST_FILE=... cargo test --lib relay_serves_tracks -- --ignored). Not yet tried on a real Chromecast.
df49b9cd
force-pushed
the
cast/track-selection
branch
from
November 14, 2026 11:51
01ac66c to
924060b
Compare
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.
While casting a movie or episode, the player's Audio and Subtitles menus (and the A/S keys) now work on the TV, and casting starts with the tracks playing here.
Also bumps the version to 0.2.0 (package.json, tauri.conf.json, Cargo.toml/lock, Flatpak metainfo release entry) and adds a WORKLOG entry;
v0.2.0is tagged frommainafter this merges.How
/cast/<token>/<n>.vttnext to the MP4, cue by cue on the receiver's clock. The receiver adds sidecar VTT through a<track>element, and Chromium parses its cues as they arrive. Each non-live LOAD offers that track and switches it on withEDIT_TRACKS_INFOonce the TV plays it.cast_controltakesaudio/subtitle, andcast_playtakes the starting tracks.Review
A multi-agent review with independent verification found these, all fixed here:
Testing
scripts/check.sh: all green (Rust tests, clippy, tsc, vitest, notices).castPropsandcastTracksFrom.TP_CAST_FILE=/path/file.mkv cargo test --lib relay_serves_tracks -- --ignoredNot yet tried on a real Chromecast. Things to check on a device:
.vttresponse show up and stay in syncKnown limit: the subtitle line already on screen at a reload point is lost, because the reload starts at the keyframe.