Skip to content

Load indexed Matroska fonts before subtitles - #245

Merged
anilbeesetti merged 1 commit into
mainfrom
fix/issue-2143
Nov 27, 2026
Merged

anilbeesetti merged 1 commit into
mainfrom
fix/issue-2143

Conversation

@anilbeesetti

Copy link
Copy Markdown
Owner

Summary

ASS subtitles can fall back to a system font when the MKV stores indexed font attachments after its video data. Load those attachments before the first subtitle sample so libass can use the authored font. Related to Next Player #2143.

Read the Matroska index
  Load trailing font attachments when indexed
  Resume extraction at the first cluster

Evidence

  • Before the fix, moving the reporter’s attachments after the video data produced the same subtitle bitmap as stripping the fonts.
  • After the fix, the reordered file rendered pixel-identically to the original sample. The new regression failed before the fix and passed afterward.
  • Android 15 emulator coverage included 26 library instrumentation tests and both Next Player subtitle playback tests. The library JVM tests also passed.

Merge risk

The change is reversible and affects Matroska ASS playback with indexed trailing fonts. The exact missing-space symptom on the reporter’s Poco remains unverified.

Created with GPT-6.2 Sol in T3 Code through Codex.

Matroska files can index font attachments after the clusters. Prefetch those fonts before reading the first cluster so ASS renders with its authored font.

Reproduced against a reordered sample from anilbeesetti/nextplayer#2143. Verified the first ASS sample, a canceled prefetch, a truncated attachment, and Next Player subtitle playback on Android 15.
@anilbeesetti
anilbeesetti merged commit b33c68e into main Nov 27, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant