Skip to content

fix(player): resolve an embedded subtitle's stream from its inventory row - #954

Closed
Quick104 wants to merge 1 commit into
feat/remux-hls-subtitle-renditionsfrom
fix/subtitle-row-stream-identity
Closed

Quick104 wants to merge 1 commit into
feat/remux-hls-subtitle-renditionsfrom
fix/subtitle-row-stream-identity

Conversation

@Quick104

@Quick104 Quick104 commented Oct 30, 2026 •

Copy link
Copy Markdown
Contributor

Problem

Related issue: N/A
Validation tasks: changes #313 C3, C4; changes #314 C3, C4

In direct play, Aether already demuxes every embedded subtitle of the open file, so switching between them should be instant. To pick one, the app needs the track's FFmpeg stream index, and it worked that out by counting embedded tracks in the catalog against embedded rows in the plan's inventory. When the two lists disagree, the pick names another stream, or none. With none, the app falls back to the row's sidecar URL, and the server extracts the track by reading the whole source file.

Approach

  • The stream index comes from the inventory row itself: its stream_index when the server sends one (contract C1, from feat(playback): honor native subtitle limitations and mark switchable tracks silo-server#3271), else the embedded_stream_index query parameter the server already puts on every embedded sidecar URL. Counting catalog tracks is the last resort. The reverse lookup no longer matches a stream to a row that names a different one.
  • The picker, the local switch on the open file, the plan intent and track persistence all read the same answer.
  • container_track_id and native_selectable are decoded too. All three fields are optional, so plans from current servers decode as before.

Affects iOS, tvOS and macOS. This is stacked on #953 only so the all-track rendition change can build on both; it doesn't need #953.

Validation

  • Build: iOS, tvOS and macOS build-only checks (Debug, Xcode 27.0) succeeded on 2a66735.
  • Unit tests: 192 tests in the protocol V3, media authorization, Aether boundary and buffering contract classes passed on an iOS 27.0 simulator (iPhone 17), ad-hoc signed.
  • Not run: playback against a server or on a device. tvOS and macOS have no test bundle.

Evidence

Evidence: https://evidence.siloserver.org/r/silo-apple/pr-954/

Risks

None identified. The URL fallback uses the same stream-index namespace as stream_index and subtitle.embedded.stream_index.

Checklist

  • I read and can explain the complete diff.
  • This pull request addresses one concern.
  • The Evidence section shows every change a user can see, or says there is none.

AI Disclosure

  • Harness: Claude Code in T3 Code
  • Tool(s): Claude Code shell and file tools; GitHub CLI; Xcode 27.0 (xcodebuild, XcodeGen) on a Mac build service
  • Model(s): claude-opus-5-5
  • Involvement: Fully AI-generated. A maintainer approved opening it; no human has run it on a device yet.
  • Adversarial review: a separate read-only Claude Code session (claude-opus-5-5) reviewed the whole stack at high effort against the protocol contract and the server's wire shape, including how the URL fallback shares the server's stream-index namespace. It found no problems in this change.

🤖 Generated with Claude Code

… row

A mid-play pick of an embedded subtitle on the open file needs the
row's FFmpeg stream index. The client derived it by counting embedded
catalog tracks against embedded inventory rows, and any disagreement
between the two lists named another stream or none. None meant the pick
fell back to the inventory sidecar URL: a whole-file server extraction
of a track Aether was already demuxing.

The row now answers first: its stream_index when the server publishes
it (contract C1), else the embedded_stream_index the server puts on
every embedded sidecar URL. Ordinal matching remains the last resort,
and the reverse lookup no longer maps a stream onto a row that names
another one. The picker, the local-switch check, the plan intent and
persistence all read the same resolution. container_track_id and
native_selectable are decoded too; all three are optional, so plans
from servers without them decode as before.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@silo-triage silo-triage Bot added the size/M 50–199 added + deleted lines (all files); change volume, not priority. label Oct 30, 2026
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 30, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-30T13:28:44.249000Z 2a66735 PR opened
🔒 Security Review ✅ Completed 2026-10-30T13:29:21.816110Z 2a66735 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@coderabbitai

coderabbitai Bot commented Oct 30, 2026

Copy link
Copy Markdown

Warning

Review limit reached

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

  • Ask an admin to enable usage-based reviews

Open in CodeRabbit

Reviews can continue after your included limit without a manual trigger. An admin must approve usage-based billing.

Next included review available in 51 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available. Your 122 included PR review attempts over the past 7 days set your current allowance at 1 review per hour.

Learn how review limits work.

Review configuration:

Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: e6f89da9-427b-4be4-8569-add6feddde13
Commits

Reviewing files that changed from the base of the PR and between c45f53c and 2a66735.

Files selected for processing: 4
  • iosApp/Tests/PlaybackProtocolV3Tests.swift
  • iosApp/iosApp/Screens/Player/ProtocolV3/ApplePlaybackV3PlanAdapter.swift
  • iosApp/iosApp/Screens/Player/ProtocolV3/PlaybackProtocolV3Models.swift
  • iosApp/iosApp/Screens/Player/ProtocolV3/ProtocolV3SubtitleSelection.swift
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Comment @coderabbitai help to get the list of available commands.

@macroscopeapp

macroscopeapp Bot commented Oct 30, 2026

Copy link
Copy Markdown

Embedded subtitle selection now resolves the selected inventory row to its own FFmpeg stream, changing which subtitle cues render and avoiding the catalog-order fallback — evidence is missing on iPhone, iPhone Duo folded and open, iPad, Mac, and Apple TV. Add a recording on each device showing selection and the resulting subtitle playback, labeled with device and build/commit (and Duo state); the selection flow and switching timing are part of the change.

Suggested fix: No diff; attach the requested recordings under Evidence or replace the placeholder with the evidence page link.

Automated check: Macroscope check run agent (gpt-6-luna). Evidence was not reviewed for correctness.

Posted via Macroscope — Visible change evidence

@silo-triage silo-triage Bot added bug Something isn't working impact: playback Can't play, stalls, or wrong media priority: P2 Limited scope, workaround exists, or polish stacked Stacked on another open PR or branch labels Oct 30, 2026
@Quick104

Copy link
Copy Markdown
Contributor Author

Superseded by #970, which combines this change with the rest of the stack for review.

@Quick104 Quick104 closed this Oct 31, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working impact: playback Can't play, stalls, or wrong media priority: P2 Limited scope, workaround exists, or polish size/M 50–199 added + deleted lines (all files); change volume, not priority. stacked Stacked on another open PR or branch

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant