Skip to content

Fix audio and subtitle selection on Android TV during transcoding#1009

Open
GustavoGarufi wants to merge 1 commit into
DonutWare:developfrom
GustavoGarufi:fix/android-tv-transcoded-tracks-ass
Open

Fix audio and subtitle selection on Android TV during transcoding#1009
GustavoGarufi wants to merge 1 commit into
DonutWare:developfrom
GustavoGarufi:fix/android-tv-transcoded-tracks-ass

Conversation

@GustavoGarufi

Copy link
Copy Markdown

Issue

When playing transcoded media on Android TV, audio and subtitle selection did not work correctly.

Audio tracks could appear unavailable or become stuck after switching. Subtitle tracks could be unavailable, fail to render, or lock the track selector after a change. ASS/SSA subtitles were especially affected during transcoding, even though the same styled subtitles could render correctly during direct play.

Fixes applied

  • Enabled selectable audio tracks and subtitle tracks on transcoded Android TV playback.
  • Fixed track switching so audio and subtitle changes no longer lock each other out.
  • Added client-side ASS/SSA rendering for transcoded sidecar subtitles.
  • Preserved ASS subtitle styling, positioning, karaoke effects, and multilingual glyph rendering.
  • Added bundled/system font fallback handling for ASS subtitles.
  • Added cached ASS sidecar loading so transcoded ASS subtitles can be toggled and switched without reloading playback.
  • Kept direct-play ASS subtitle rendering working through the existing native path.

Technical breakdown

This PR updates the Android TV native player path so transcoded playback can apply audio and subtitle selections in-place where possible.

For ASS/SSA subtitles during transcoding, the native player now avoids loading multiple ASS sidecar tracks through ExoPlayer, which can crash or fail on some Android TV devices. Instead, ASS/SSA sidecar subtitles are downloaded and cached by the app, then rendered through the existing libass overlay path. Only the selected ASS track is attached to the renderer at a time, which keeps switching fast while avoiding the multi-track native crash path.

The ASS renderer path keeps styling, positioning, karaoke effects, and fallback font behavior intact. Transcoded subtitles are requested without forcing server-side burn-in so the client can render and switch them locally.

Track selection updates are also forwarded immediately to the native player before the Flutter playback model reload path runs. For supported transcoded subtitle changes, reload is skipped so subtitles can be toggled or switched without a black-screen reload.

Tested manually on a TCL C1 projector using Android TV native playback.

Tested

  • Transcoded ASS subtitles render correctly.
  • ASS styling, karaoke effects, positioning, kana, and kanji render correctly.
  • Subtitle on/off works without playback reload.
  • Multiple transcoded subtitle tracks switch in real time.
  • Multiple transcoded audio tracks switch correctly.
  • Audio and subtitle switching do not lock each other out.
  • Direct-play ASS subtitles still render normally.

Issues

Closes #912.
Closes #473.
Closes #919.

Related to #447, but not marked as closed because that report appears to involve a different platform/playback path. Additional testing would be helpful there.

AI use disclosure

This fix was developed with assistance from ChatGPT Codex for debugging, implementation guidance, and iterative test-build analysis. The final changes were manually tested on real Android TV hardware before submission.

@GustavoGarufi GustavoGarufi force-pushed the fix/android-tv-transcoded-tracks-ass branch 5 times, most recently from 0b56d27 to 1c78fce Compare June 2, 2026 00:34
Enable Android TV native playback to switch audio and subtitle tracks during transcoded playback without locking the player controls.

Render transcoded ASS/SSA sidecar subtitles client-side with libass, including styling, positioning, karaoke effects, multilingual glyphs, fallback fonts, and cached in-place subtitle switching.
@GustavoGarufi GustavoGarufi force-pushed the fix/android-tv-transcoded-tracks-ass branch from 1c78fce to b835246 Compare June 2, 2026 00:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant