Skip to content

fix(player): play an ASS pick that the server burns in on an HLS transcode - #1010

Merged
Quick104 merged 5 commits into
Silo-Server:mainfrom
Rhainland:fix/tv-subtitle-replan-transcode-switch
Nov 22, 2026
Merged

Quick104 merged 5 commits into
Silo-Server:mainfrom
Rhainland:fix/tv-subtitle-replan-transcode-switch

Conversation

@Rhainland

@Rhainland Rhainland commented Nov 20, 2026 •

Copy link
Copy Markdown
Contributor

Problem

Related issue: N/A
Validation tasks: changes #324 C3; changes #323 C3
Paired pull requests (same report): Silo-Server/silo-server#4639, Silo-Server/silo-server#4640, Silo-Server/silo-server#4641, Silo-Server/silo-server#4642, #1011, #1012, #1013, Silo-Server/silo-apple#1237, Silo-Server/AetherEngine#30

Other clients: Apple N/A (the Apple players already adopt a burn-in plan for a sidecar pick; checked on iOS and tvOS with the same files); Roku N/A (Roku does not validate the plan's subtitle mode); Web N/A (the web player adopts the plan's burn_in mode)

On Android TV, picking an ASS subtitle while a video plays through an HLS transcode never turned the subtitles on. The HLS delivery declares no attached-font support, so the server answers the subtitle_track_changed replan by burning the ASS track into the video. The TV subtitle adapter only accepted a rendered sidecar for a sidecar pick, rejected the answer with "The candidate did not render the requested sidecar." and discarded it. The replan keeps the session id, so the server had already restarted the transcode with burn-in: the old player kept playing without subtitles, fetched segments from the replaced transcode, and seeked to the end of the file. The phone adapter had the same check.

This change makes both apps accept the burn-in answer and play it.

Approach

A sidecar pick that the plan answers with BURN_IN now commits as a ServerBurnIn identity of the same track (the shared deliveredAs). The player remounts at the current position with no sidecar and no text renderer, as it does for any burned-in track.

The committed identity now differs from the row the viewer picked, so the places that compare a row or pick with the committed identity use the shared playsAs instead of ==:

  • the subtitle menu checks the picked row (TV menu, phone sheet);
  • an Auto pick the server burns in is not saved as the viewer's choice, and the series subtitle choice is saved once the burn-in commits;
  • a saved burn-in preference restores to the sidecar row on the next playback, and the phone's route intent records the pick;
  • a later replan that leaves the transcode (quality, audio, output route) can hand the track back as a sidecar, which validation now accepts and commits as that sidecar;
  • the TV appearance pane reads what plays, so it shows the burned-in note instead of styling controls.

Load, seek recovery and session recovery apply the plan's mode the same way (deliveredAs), so the committed identity matches what plays on every path. During a burn-in, TV session recovery and remounts ask the server for that track instead of for Off. Picking the checked row whose burn-in already plays sends no replan; it is saved and settles like any explicit pick.

Pairs with the other changes for the same report: silo-server "fix(playback): don't learn a bandwidth limit from a stall the server's transcode caused" (Silo-Server/silo-server#4640) and the Android PRs for the subtitle menu, the libass overlay and buffering evidence.

Validation

  • ./scripts/test-check-build-supply-chain.sh and ./scripts/check-build-supply-chain.sh: pass.
  • ./gradlew testDebugUnitTest: pass (new tests: TV and phone adapter commits for the burn-in answer and the way back to a sidecar, TV persistence and restore, phone row resolution, shared deliveredAs/playsAs).
  • :android-shared:lintDebug :androidApp:lintDebug :androidTvApp:lintDebug :androidApp:lintVitalRelease :androidTvApp:lintVitalRelease: pass.
  • :androidApp:assembleDebug :androidTvApp:assembleDebug: pass.
  • Review follow-ups (maintainer review): the PR's four behavior tests fail on main and pass here; the review's adapter tests (re-picking the burned-in row sends no replan and is saved, on both apps; a saved burn-in restored as its sidecar row is already committed, TV) fail on 3a1fc5d and pass here. Unit suites: shared 2513, androidTvApp 1413, androidApp 1013, 0 failures.
  • Review live check on an Android TV emulator against a server built from main: the mid-play ASS pick burns in; at 3a1fc5d re-picking the checked row restarted the transcode and a start that burns in from the first segment offered styling controls over the burned-in captions; after the follow-ups neither happens.
  • Played "H264 MoreFonts (2018)" (synthetic MKV with an ASS track and many embedded fonts) on an Android TV emulator and an Android phone emulator against a local server, picking the ASS track mid-play on an HLS transcode (before the review follow-ups; the evidence page now shows the review's captures).

Evidence

Evidence: https://evidence.siloserver.org/r/silo-android/pr-1010/

Surface and build: Android TV emulator (Android 16, 1080p) against a server built from main, debug builds of this branch before (3a1fc5d) and after (4190331) the review follow-ups; the page shows the burn-in pick and the two follow-ups a viewer can see. The phone change is covered by unit tests. Tablet and foldable not captured: the change is in the subtitle transaction, not in layout.

Risks

A burned-in pick restores as its sidecar row on the next playback; on an HLS transcode the server burns it in again. No migration.

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
  • Tool(s): Claude Code, Codex CLI (review only)
  • Model(s): claude-opus-5-5 (author and reviewer); gpt-6.2-sol and gpt-6.2-astra via Codex CLI, Claude Fable 5.2 (reviewers)
  • Involvement: Fully AI-generated, human verified
  • Adversarial review: three rounds of a four-model review (Sol, Astra, Opus, Fable) on the branch diff. Fixed: a committed burn-in that a later replan handed back as a sidecar was refused; Auto picks the server burned in were saved as viewer choices; a saved burn-in preference did not restore on TV; the phone matched the row by index only; the series choice and phone route intent never recorded a burned-in pick; the TV appearance pane offered styling for burned-in subtitles. Dismissed: seek and session recovery rebuilding the identity without the plan mode (existing behavior on a fresh HLS start), catalog matching of embedded tracks (same limit as sidecar picks today). A maintainer review with a three-model council (Sol, Opus, Gemini) followed; its findings and fixes are in the review and its summary comment.

Note

Fix subtitle selection when the server burns in an ASS pick on HLS transcode

  • Adds SubtitleIdentity.playsAs and SubtitleIdentity.deliveredAs in SubtitleTransition.kt to compare and convert between ServerSidecar and ServerBurnIn identities for the same track
  • Selection, validation, restoration, and persistence paths across the mobile and TV players now treat a committed burn-in as matching its sidecar row, so picking that row no longer starts a new subtitle transaction
  • Committed identities are derived using the plan's delivery mode, and saved burn-in preferences resolve back to their hydrated sidecar rows
  • Behavioral Change: playsAs is directional — a sidecar plays as its burn-in, but not the reverse; all comparisons in PlayerViewModel, TvPlayerViewModel, TvSubtitleTransactionAdapter, MobileSubtitleTransactionAdapter, TvPlayerSubtitlePolicy, and MobileSubtitleAutoSelection were updated to this semantic

Macroscope summarized 4534909.

When a TV viewer picks a server sidecar subtitle during a server
transcode, the server may answer the subtitle_track_changed replan by
burning the track in instead. An ASS track on an HLS transcode is the
common case: that delivery declares no attached-font support, so the
planner burns it in to keep its styling. The adapter rejected that
answer as "did not render the requested sidecar" and discarded the
candidate. The replan keeps the session id, so the discard stopped
nothing, while the server had already restarted the session's
transcode with burn-in. The old player kept playing without subtitles
and fetched segments from the replaced transcode, which drove seek
restarts to the end of the file.

Accept a burn-in candidate for a sidecar pick when it selects the
requested track, and commit it as a burn-in identity (the shared
deliveredAs), so the screen remounts at the current position without
attaching a sidecar or waiting for a mounted text track.

The committed burn-in identity stands for the sidecar row the viewer
picked (the shared playsAs), so:
- the subtitle menu checks that row;
- an Auto pick the server burns in is not saved as the viewer's choice,
  and selectAuto treats it as already committed;
- the series subtitle choice is saved once the burn-in commits;
- a saved burn-in preference restores to the sidecar row next time;
- the appearance pane reads what plays, so it explains that burned-in
  subtitles ignore styling;
- a later replan that leaves the transcode (quality, audio, output
  route) may hand the same track back as a sidecar, which validation
  now accepts and commits as that sidecar, instead of stranding the
  player the other way round.
The phone subtitle adapter had the same rejection as the TV one: when
the server answers a sidecar pick with a burn-in plan (an ASS track on
an HLS transcode, which declares no attached-font support), validation
failed with "did not render the requested sidecar" and the candidate
was discarded. The replan keeps the session id, so the server had
already switched the session's transcode while the old player kept
playing without subtitles.

Accept a burn-in candidate for a sidecar pick when it selects the
requested track, and commit it as a burn-in identity, so the player
remounts with the text renderer off and no sidecar attached. The
subtitle menu resolves that burn-in identity to the exact sidecar row
the viewer picked, the series subtitle choice is saved once it
commits, and a later replan that hands the track back as a sidecar is
accepted.
@silo-triage silo-triage Bot added the size/L 200–499 added + deleted lines (all files); change volume, not priority. label Nov 20, 2026
@silo-kody

silo-kody Bot commented Nov 20, 2026 •

Copy link
Copy Markdown

Silo Kody — review complete

Review finished. Check the inline comments for findings and verify each suggestion against the code and tests.

Reviewing changes in Silo
  • Include the related issue, expected behavior, and validation steps in the PR description.
  • For API changes, describe the effect on Apple and Android clients and Jellyfin compatibility.
  • For plugin changes, identify the affected SDK contract, plugin, and catalog entry.
  • Follow this repository's AGENTS.md and CONTRIBUTING.md.
  • Request another review with @kody start-review in a PR comment.
  • React with 👍 or 👎 to give feedback on individual suggestions.
Review settings
Review Options

The following review options are enabled or disabled:

Options Enabled
Bug ✅
Performance ✅
Security ✅
Business Logic ❌

@coderabbitai

coderabbitai Bot commented Nov 20, 2026 •

Copy link
Copy Markdown

Explain Change →

Walkthrough

Subtitle identities now reflect how the server delivers a track. Mobile and TV selection, transaction, persistence, and presentation logic match sidecar and burn-in representations of the same subtitle.

Changes: Subtitle identity reconciliation

Layer / File(s) Summary
Delivery-aware identity mapping
shared/src/commonMain/.../SubtitleTransition.kt, shared/src/commonTest/.../SubtitleTransitionTest.kt
Adds deliveredAs to map identities by delivery mode and playsAs to match a sidecar identity with its corresponding burn-in identity. Tests cover delivery modes and identity matching.
Subtitle transaction validation and commit
androidApp/src/androidMain/.../MobileSubtitleTransactionAdapter.kt, androidTvApp/src/androidMain/.../TvSubtitleTransactionAdapter.kt, androidApp/src/androidUnitTest/.../MobileSubtitleTransactionAdapterTest.kt, androidTvApp/src/androidUnitTest/.../TvSubtitleTransactionAdapterTest.kt
The adapters accept the described sidecar and burn-in delivery cases and record non-client-owned committed identities according to delivery mode. Tests cover candidates delivered as burn-in or sidecar.
Selection, persistence, and presentation matching
androidApp/src/androidMain/.../{MobilePlayerRouteTarget.kt,MobileSubtitleAutoSelection.kt,PlayerViewModel.kt}, androidApp/src/androidUnitTest/.../MobileSubtitleAutoSelectionTest.kt, androidTvApp/src/androidMain/.../{TvPlayerSubtitlePolicy.kt,TvPlayerViewModel.kt,TvSubtitleHudState.kt,TvPlayerHud.kt}, androidTvApp/src/androidUnitTest/.../{TvPlayerSubtitleIntegrationPolicyTest.kt,TvQuickSubtitlePickerChromePolicyTest.kt}
Mobile and TV selection, restore, and commit checks use playback-aware identity matching. TV presentation carries the committed identity and uses it for focus and checked-row matching. Tests cover identity resolution and preference preservation.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Change: Bug fix

Suggested reviewers: quick104, rxwatcher

Merge Risk: Low · up to 9cc64

Selecting an ASS subtitle that the server burns in now plays correctly. Two edge cases remain: a decoder recovery on TV can drop the burned-in subtitle, and a saved burn-in preference may not restore if the track's index changes. Neither blocks the main fix. The handback tests should also assert the final committed identity.

Security architecture risk: Minimal · up to 9cc64

The inspected changes reconcile two delivery forms of the same subtitle track while retaining existing selection and ownership controls. No introduced or worsened security, failure-containment, or ownership regression was established.

Retained concerns
No architecture-level concerns identified.

Security review details

Security Blast Radius

  • inferred — The inspected effects reach the active playback session and the viewer's saved movie or series subtitle choice, which may influence later playback on other devices. The widened identity comparison does not itself grant a new account, server, or content-selection authority.

Trust Boundaries and Controls

  • observed — The changed acceptance consumes the existing server-plan response rather than introducing a new external input channel. Same-file validation still checks the requested subtitle index; client-owned downloaded and local identities retain separate handling, including rejection of unexpected server burn-in. TV also retains output-route-generation and requested-quality checks.

Resilience and Maintainability Implications

  • observed — Both adapters reject superseded candidates before commit and check adoption ownership before accepting its outcome. TV serializes publication settlement, restores the prior ownership state on successful rollback, and exposes rollback failure instead of treating it as successful recovery.
Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title names the primary change: Android TV and phone players now accept and play an ASS subtitle pick that the server burns into an HLS transcode. The raw summary covers this through deliveredAs, …
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Description check Passed The description is specific to the changeset. It explains that Android TV and phone subtitle adapters rejected a burn-in answer to a sidecar subtitle pick during HLS transcodes, and it describes the f…
Full details: Title check

Explanation

The title names the primary change: Android TV and phone players now accept and play an ASS subtitle pick that the server burns into an HLS transcode. The raw summary covers this through deliveredAs, playsAs, and the adapter validation changes. The title is specific and matches the objectives. It uses the conventional fix(player) prefix and is 74 characters, which is acceptable.

Full details: Description check

Explanation

The description is specific to the changeset. It explains that Android TV and phone subtitle adapters rejected a burn-in answer to a sidecar subtitle pick during HLS transcodes, and it describes the fix: a new deliveredAs/playsAs identity handling, adapter validation changes, TV HUD committedIdentity, and the related unit tests and evidence. This matches the raw summary of the file changes, so the check passes.

Finishing Touches

Generate unit tests (beta)

  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

@macroscopeapp

macroscopeapp Bot commented Nov 20, 2026

Copy link
Copy Markdown

The change is visible, but the Evidence section says “pending upload” and contains no screenshots or recording. The stated reason for omitting tablets and foldables does not rule them out: the mobile subtitle transaction and shared identity logic also run on those phone-app form factors.

  • ASS subtitle playback when a sidecar pick is burned in, and when a later replan returns it as a sidecar — Android phone, tablet, foldable folded and open, and Android TV are missing evidence; add before/after captures for each, plus a recording of the multi-step subtitle/replan flow, identifying each device and build or commit.
  • Subtitle selection and appearance states (the picked row remains identified, and TV shows the burned-in note instead of styling controls) — phone, tablet, and foldable folded and open are missing subtitle-sheet captures; Android TV is missing subtitle-menu and appearance-pane captures. Add before/after captures of the same screens and data on each applicable device, identifying each device and build or commit.

Suggested fix: No diff — upload the requested captures and recording, or explain why any affected device could not be captured.

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: P1 Core-path bug; painful workaround — next after P0 labels Nov 20, 2026

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

Caution

Some comments are outside the diff and can’t be posted inline due to GitHub limitations.

⚠️ Outside diff range comments (1)

Minor · Keep the committed burn-in track when no text renderer is mounted. · TvPlayerViewModel.kt:3792

androidTvApp/src/androidMain/kotlin/org/siloserver/silo/tv/ui/screens/player/TvPlayerViewModel.kt:3792
Minor · Functional Correctness · Quick win

Keep the committed burn-in track when no text renderer is mounted.

After a ServerBurnIn commit, no text renderer is mounted. selectedSubtitleTrackIndex then returns -1 at line 3792. Replans that do not pass subtitleTrackIndexOverride use that value. The start-failure path at line 3389 is one example. PlaybackSessionManager converts -1 to a null subtitle selection. The replan request then omits the burned-in subtitle, and the recovered stream can lose it.

Resolve the committed burn-in index before the mounted-row lookup. When state.committedSubtitleIdentity is SubtitleIdentity.ServerBurnIn, return its server track index. Keep the existing mounted-row resolution for client-rendered subtitles. Keep subtitleTrackIndexOverride as the first choice.

Nitpick comments: 1

androidTvApp/src/androidUnitTest/kotlin/org/siloserver/silo/tv/ui/screens/player/TvSubtitleTransactionAdapterTest.kt: 1

999-1001: Trivial · Maintainability & Code Quality · Quick win

Assert the final sidecar identity after the handback completes.

The handback assertions check only the port commit. They do not check committedIdentity. A handback that passes validation but keeps ServerBurnIn as the committed identity still passes these tests. Complete the mounted boundary with confirmPendingPlayerBoundary, as the other sidecar tests in this file do. Then assert that committedIdentity equals requested, and that the pending identity is cleared. Check that persistence records the sidecar identity if the handback path persists it.

Apply the same assertions to the handback test in MobileSubtitleTransactionAdapterTest. It has the same gap.

Suggested test change (TV)

         assertEquals(emptyList(), harness.port.discarded)
         assertEquals(listOf("hls-burn-in", "back-to-sidecar"), harness.port.committed)
         assertNull(harness.adapter.snapshot.failureMessage)
+        assertEquals(requested, harness.adapter.snapshot.committedIdentity)
Review info

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: 2104aeb4-3606-4fd3-9b11-2da44efe9da3
Commits

Reviewing files that changed from the base of the PR and between 1b4732d and 9cc64ea.

Files selected for processing: 16

  • androidApp/src/androidMain/kotlin/org/siloserver/silo/android/ui/screens/player/MobilePlayerRouteTarget.kt
  • androidApp/src/androidMain/kotlin/org/siloserver/silo/android/ui/screens/player/MobileSubtitleAutoSelection.kt
  • androidApp/src/androidMain/kotlin/org/siloserver/silo/android/ui/screens/player/MobileSubtitleTransactionAdapter.kt
  • androidApp/src/androidMain/kotlin/org/siloserver/silo/android/ui/screens/player/PlayerViewModel.kt
  • androidApp/src/androidUnitTest/kotlin/org/siloserver/silo/android/ui/screens/player/MobileSubtitleAutoSelectionTest.kt
  • androidApp/src/androidUnitTest/kotlin/org/siloserver/silo/android/ui/screens/player/MobileSubtitleTransactionAdapterTest.kt
  • androidTvApp/src/androidMain/kotlin/org/siloserver/silo/tv/ui/screens/player/TvPlayerHud.kt
  • androidTvApp/src/androidMain/kotlin/org/siloserver/silo/tv/ui/screens/player/TvPlayerSubtitlePolicy.kt
  • androidTvApp/src/androidMain/kotlin/org/siloserver/silo/tv/ui/screens/player/TvPlayerViewModel.kt
  • androidTvApp/src/androidMain/kotlin/org/siloserver/silo/tv/ui/screens/player/TvSubtitleHudState.kt
  • androidTvApp/src/androidMain/kotlin/org/siloserver/silo/tv/ui/screens/player/TvSubtitleTransactionAdapter.kt
  • androidTvApp/src/androidUnitTest/kotlin/org/siloserver/silo/tv/ui/screens/player/TvPlayerSubtitleIntegrationPolicyTest.kt
  • androidTvApp/src/androidUnitTest/kotlin/org/siloserver/silo/tv/ui/screens/player/TvQuickSubtitlePickerChromePolicyTest.kt
  • androidTvApp/src/androidUnitTest/kotlin/org/siloserver/silo/tv/ui/screens/player/TvSubtitleTransactionAdapterTest.kt
  • shared/src/commonMain/kotlin/org/siloserver/silo/model/playback/SubtitleTransition.kt
  • shared/src/commonTest/kotlin/org/siloserver/silo/model/playback/SubtitleTransitionTest.kt

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.

A saved burn-in of a sidecar pick now matches that sidecar row by its
media when the row comes back at another index; before, the typed
fallback required the same identity kind and returned nothing.
@silo-kody

silo-kody Bot commented Nov 20, 2026 •

Copy link
Copy Markdown

Silo Kody — review complete

Review finished. Check the inline comments for findings and verify each suggestion against the code and tests.

Reviewing changes in Silo
  • Include the related issue, expected behavior, and validation steps in the PR description.
  • For API changes, describe the effect on Apple and Android clients and Jellyfin compatibility.
  • For plugin changes, identify the affected SDK contract, plugin, and catalog entry.
  • Follow this repository's AGENTS.md and CONTRIBUTING.md.
  • Request another review with @kody start-review in a PR comment.
  • React with 👍 or 👎 to give feedback on individual suggestions.
Review settings
Review Options

The following review options are enabled or disabled:

Options Enabled
Bug ✅
Performance ✅
Security ✅
Business Logic ❌

@macroscopeapp

macroscopeapp Bot commented Nov 20, 2026

Copy link
Copy Markdown

The Evidence link is present and the PR description identifies phone and Android TV playback captures, but it explicitly omits tablet and foldable captures. The reason given (“not a layout change”) does not rule them out: the changed mobile player path also runs on those form factors.

  • Sidecar-to-burn-in playback, replan handback, and selected-row/restore behavior (MobileSubtitleTransactionAdapter.kt, MobileSubtitleAutoSelection.kt, PlayerViewModel.kt, and shared/.../SubtitleTransition.kt): the evidence page should show this flow on an Android tablet and an Android foldable both folded and open; the PR says these captures are missing. Include a recording of the multi-step replan flow.
  • TV subtitle-menu checked state and burned-in appearance note (TvSubtitleHudState.kt, TvPlayerHud.kt): the evidence page should show these changed states on Android TV, in addition to playback, so reviewers can verify the UI behavior.

Suggested fix: No diff — add the missing captures and flow recording to the evidence page, or explain why an affected device could not be captured.

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

Posted via Macroscope — Visible change evidence

@Rhainland

Copy link
Copy Markdown
Contributor Author

Evidence is now published: https://evidence.siloserver.org/r/silo-android/pr-1010/ (the body said "pending upload" for a minute while it went up). It has Android TV before and after, and phone after. I did not capture a tablet or foldable: the change is in the subtitle transaction and identity matching, and the sheet looks the same on those layouts, so the captures would only repeat the phone one.

@Quick104 Quick104 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review of 3a1fc5d. The fix works: on an Android TV emulator against a server built from main, picking the ASS track during an HLS transcode now burns it in and keeps playing, and the series subtitle choice is saved. All four new behavior tests fail on main and pass here.

Three findings, all in what happens after the burn-in commits. I'm fixing each one in a commit on this branch, so there's no need to change anything yourself.

🤖 Claude Code (claude-opus-5-5)

A sidecar pick the server burns in committed as burn-in only on the
staged replan. Three gaps remained after that commit:

- Picking the checked row again staged a replan, because the sidecar row
  is not equal to the committed burn-in. The server restarted the
  transcode for the same answer. Both adapters' select() now return early
  when the pick plays as the committed identity and nothing is in flight,
  as selectAuto already did.
- Load, seek recovery and session recovery built the committed identity
  from the inventory row, which says sidecar for an ASS track under a
  burn-in plan. The identity flipped back to a sidecar while the video
  stayed burned in, so TV offered styling and subtitle delay again and
  the phone stopped forcing its text renderer off. These paths now apply
  the plan's subtitle mode through deliveredAs, as the staged commit does.
- Several comparisons of a pick with the committed identity still used
  ==: the TV fresh restore and its deferred drain, the fresh-restore
  rollback match, the TV auto shortcut, the staged series write match on
  both apps, the phone's deferred pick, and the HUD applying flag. They
  now use playsAs, and the restore branches check the committed identity
  for burn-in, so nothing tries to mount a sidecar for captions already
  in the video.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@silo-kody

silo-kody Bot commented Nov 22, 2026 •

Copy link
Copy Markdown

Silo Kody — review complete

Review finished. Check the inline comments for findings and verify each suggestion against the code and tests.

Reviewing changes in Silo
  • Include the related issue, expected behavior, and validation steps in the PR description.
  • For API changes, describe the effect on Apple and Android clients and Jellyfin compatibility.
  • For plugin changes, identify the affected SDK contract, plugin, and catalog entry.
  • Follow this repository's AGENTS.md and CONTRIBUTING.md.
  • Request another review with @kody start-review in a PR comment.
  • React with 👍 or 👎 to give feedback on individual suggestions.
Review settings
Review Options

The following review options are enabled or disabled:

Options Enabled
Bug ✅
Performance ✅
Security ✅
Business Logic ❌

@macroscopeapp

macroscopeapp Bot commented Nov 22, 2026

Copy link
Copy Markdown

The Evidence section links to captures, but it identifies playback captures made before the current follow-up commit. The current changes add user-visible behavior those captures do not cover, and the same mobile player code reaches tablets and foldables; “not a layout change” does not explain why the change cannot reach them.

  • Subtitle playback and re-selection (MobileSubtitleTransactionAdapter.kt, PlayerViewModel.kt, TvSubtitleTransactionAdapter.kt, TvPlayerViewModel.kt): the burn-in, handback, and no-op repeat-selection behavior reaches the phone app on phones, tablets, and foldables folded and open, and the TV app. The described phone-after and TV before/after captures predate the follow-ups; add a current-head recording of the multi-step flow and captures on tablets and foldables folded and open.
  • Subtitle selection and appearance states (MobileSubtitleAutoSelection.kt, TvSubtitleHudState.kt, TvPlayerHud.kt): the checked subtitle row reaches phones, tablets, foldables folded and open, and TV; the burned-in appearance pane is TV-only. The evidence description does not identify captures of these states. Add before-and-after captures of the subtitle sheet/menu and TV appearance pane, on each applicable device.

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

Posted via Macroscope — Visible change evidence

Comment on lines +418 to +422
if (identity != transition.committed.identity &&
identity.playsAs(transition.committed.identity) &&
!hasActiveTransaction
) {
return

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

kody code-review Bug high

Reselecting a burned-in subtitle leaves stale refreshes authoritative

An in-flight refresh can later auto-select a subtitle and override the user's explicit choice. Increment refreshGeneration and subtitleIntentGeneration before returning here and in the equivalent TV shortcut.

Prompt for LLM
File androidApp/src/androidMain/kotlin/org/siloserver/silo/android/ui/screens/player/MobileSubtitleTransactionAdapter.kt, lines 418-422:

Reselecting a burned-in subtitle leaves stale refreshes authoritative

An explicit pick of the currently burned-in row returns without invalidating an in-flight subtitle refresh, allowing its later auto-selection to override the user's choice. Increment the refresh and subtitle-intent generations before returning here and in the equivalent TV shortcut.

Suggested code:

if (identity != transition.committed.identity &&
    identity.playsAs(transition.committed.identity) &&
    !hasActiveTransaction
) {
    refreshGeneration += 1
    subtitleIntentGeneration += 1
    return
}

Talk to Kody by mentioning @kody

Was this suggestion helpful? React with 👍 or 👎 to help Kody learn from this interaction.

​

​

Comment on lines +692 to +697
if (identity != transition.committed.identity &&
identity.playsAs(transition.committed.identity) &&
!hasActiveTransaction
) {
SubDiag.log("ADAPTER select NOOP $identity plays as ${transition.committed.identity}")
return

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

kody code-review Bug medium

Explicitly selecting the playing burn-in skips per-item persistence

The viewer's manual preference is lost on a later load, even though the series choice is saved. Persist the committed selection for this explicit no-op without restarting playback.

Prompt for LLM
File androidTvApp/src/androidMain/kotlin/org/siloserver/silo/tv/ui/screens/player/TvSubtitleTransactionAdapter.kt, lines 692-697:

Explicitly selecting the playing burn-in skips per-item persistence

When a viewer explicitly selects the automatically chosen burned-in track, this return skips the per-item persistence callback, so the manual preference is lost on a later load even though the series choice is saved. Persist the committed selection for this explicit no-op without restarting playback.

Talk to Kody by mentioning @kody

Was this suggestion helpful? React with 👍 or 👎 to help Kody learn from this interaction.

​

​

Follow-ups from the second review round of the burn-in commit:

- TV asked for subtitles Off on session recovery, on the detail screen's
  return and on same-route remounts during a burn-in, because no text
  track is selected while the captions are in the video. It now asks for
  the committed burn-in's server index, and a remount does not arm a
  sidecar reselection for that track.
- Picking the checked row whose burn-in already plays skips the replan
  but is still an explicit pick: both apps now clear a stale failure,
  invalidate a pending refresh, save the choice and publish the snapshot,
  which also settles the phone's route intent for that pick.
- The phone's load applied the plan's burn-in mode to the row of an
  explicit pick even when that row resolved to another track than the
  plan's (two tracks with the same label). The mode now applies only to
  the plan's own selected track.
- The TV HUD's applying flag matches the picked row to a pending burn-in
  of it.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@silo-kody

silo-kody Bot commented Nov 22, 2026 •

Copy link
Copy Markdown

Silo Kody — review complete

Review finished. Check the inline comments for findings and verify each suggestion against the code and tests.

Reviewing changes in Silo
  • Include the related issue, expected behavior, and validation steps in the PR description.
  • For API changes, describe the effect on Apple and Android clients and Jellyfin compatibility.
  • For plugin changes, identify the affected SDK contract, plugin, and catalog entry.
  • Follow this repository's AGENTS.md and CONTRIBUTING.md.
  • Request another review with @kody start-review in a PR comment.
  • React with 👍 or 👎 to give feedback on individual suggestions.
Review settings
Review Options

The following review options are enabled or disabled:

Options Enabled
Bug ✅
Performance ✅
Security ✅
Business Logic ❌

@Quick104

Copy link
Copy Markdown
Contributor

Review summary

Reviewed head: 4534909 (the PR's 3a1fc5d plus two review commits, 4190331 and 4534909).

Fit: 9/10 · Readiness: 8/10 — conditional (assuming CI is green)

Fit: this makes both Android apps turn on a subtitle the viewer picked, using the delivery the server chose, as the Apple apps already do. The server stays the only authority on burn-in, and the change adds no setting or new surface.

Readiness: the fix works live and its tests fail on main. The one condition is the last review commit, 4534909. Its TV recovery change (ask the server for the burned-in track instead of Off) is backed by a source trace and the unit suites, but no test covers it, it wasn't checked live, and the council's last scores are for 4190331.

What was found and fixed on this branch

  • Picking the checked row again restarted the transcode (Medium). The re-pick now sends no replan. It still counts as an explicit pick: it's saved, clears a stale failure, cancels a pending refresh, and settles the phone's route intent.
  • The burn-in identity held only until the next load, seek, or session recovery (Medium). Those paths now apply the plan's subtitle mode, so the TV options pane no longer offers styling and timing over burned-in captions.
  • TV session recovery and remounts asked for subtitles Off during a burn-in (Medium). No text track is selected while the captions are in the video, so the request read as Off. Recovery now asks for the committed burn-in's index, and a remount doesn't arm a sidecar reselection for it.
  • Remaining == comparisons of a pick with the committed identity (Low): TV fresh restore and its deferred drain, the fresh-restore rollback match, the TV auto shortcut, the staged series-write match on both apps, the phone's deferred pick, and the HUD's applying flag.
  • The phone marked an explicit pick's row as burned in when that row wasn't the plan's track (two tracks with the same label). The burn-in mode now applies only to the plan's own selected track.

Verification

  • Live, on an Android TV emulator against a server built from main (3fd01aa6), with an ASS track on an HLS transcode. At 3a1fc5d the mid-play pick burns in and saves the series choice; re-picking the checked row restarted the transcode; a detail-page start that burns in from the first segment (subtitle_burn_in_required) offered Size, Appearance, and Timing over the captions. At 4190331 the re-pick sends nothing and those controls are disabled with the burned-in note.
  • The PR's four behavior tests fail on main and pass. The review's three adapter tests fail on 3a1fc5d and pass. Unit suites at 4534909: androidTvApp 1413 and androidApp 1013 tests, 0 failures; shared 2513 at 4190331 (4534909 doesn't touch shared).
  • Not reproduced: a predicted TV "could not be mounted" error on reopen. Reopening and detail-page burn-in starts both played with subtitles and no error.
  • Evidence: https://evidence.siloserver.org/r/silo-android/pr-1010/

Left for the maintainers

These behave the same way on main, so they stay out of this PR:

  • A native embedded track that a later plan answers with a burn-in is still rejected on both apps.
  • Discarding a superseded first pick leaves that pick's server plan in place if the second pick then fails.
  • Subtitle identity equality includes the label, so a whitespace difference between catalog and inventory labels breaks matching.
  • TV fresh restore misses a saved ASS choice when the next session delivers that track as embedded (direct play).
  • TV detail-page starts that burn in from the first segment never consume the launch subtitle index.
  • The phone resolves an explicit start pick by label before the plan's index, so two same-labeled tracks can resolve to the wrong row. This change narrows the effect but doesn't fix it.
  • The phone still offers subtitle delay and style during any burn-in (TV disables both).

Design note: one reviewer suggested keeping the viewer's pick as the committed identity and reading "burned in" from the plan's mode instead. This branch completes the identity model the PR chose, which ServerBurnIn already uses for mounting, the text renderer, and the appearance controls.

Checks

  • Validated features: not run. The review account lacks the read:project scope. The body's Validation tasks: line is the author's.
  • User manual: unaffected. No siloserver.org page describes this path, and the fix makes the apps do what a viewer expects.
  • Apple/Android parity: Apple already adopts a burn-in answer to a sidecar pick (ProtocolV3SidecarRestoreIntent maps a burnIn plan to .serverRendered). No Apple change needed.
  • silo-server#4641: no dependency. Android sends no silo_transport marker and declares no matching feature. If #4641 gates the marker behind a client-declared HLS feature, Android needs its own follow-up to opt in.

Council

Member Round 1 (3a1fc5d) Round 2 (4190331)
Sol (gpt-6.2-sol, xhigh) 6/10 8/10
Opus (claude-opus-5-5, high) 6/10 8.5/10
Gemini (gemini-4-neon, xhigh) 6/10 7/10

4534909 fixes the round-2 findings this PR caused. The council didn't re-score it; the review stops after two rounds.

🤖 Claude Code (claude-opus-5-5)

@Quick104
Quick104 merged commit c89bdf3 into Silo-Server:main Nov 22, 2026
10 checks passed
Quick104 added a commit to Rhainland/silo-android that referenced this pull request Nov 22, 2026
Resolve the TvSubtitleHudState conflict with Silo-Server#1010: the row's plays()
check now builds on playsAs, so a burned-in sidecar pick and a saved
player-track choice both check their server row.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
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: P1 Core-path bug; painful workaround — next after P0 size/L 200–499 added + deleted lines (all files); change volume, not priority.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants