Fix audio and subtitle selection on Android TV during transcoding#1009
Open
GustavoGarufi wants to merge 1 commit into
Open
Fix audio and subtitle selection on Android TV during transcoding#1009GustavoGarufi wants to merge 1 commit into
GustavoGarufi wants to merge 1 commit into
Conversation
0b56d27 to
1c78fce
Compare
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.
1c78fce to
b835246
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.
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
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
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.