Skip to content

Conversation

@dmitrylyzo
Copy link
Collaborator

@dmitrylyzo dmitrylyzo commented Jun 6, 2023

Pulling from the upstream.
Original author: WeebDataHoarder

Non-PR commit (picked from libass#146)

ASS subtitles can embed fonts with a custom encoding in
their [Fonts] section. For historic reasons ass_set_extract_fonts
defaults to disabled, so we need to explicitly opt-in.
There’s currently also an issue, with embedded fonts outliving
their track, which can lead to indefinitely growing memory consumption
if not all memory fonts are cleared on track reinit.

However, ass_clear_fonts can only be safely called if the renderer
also has been released first. At this point it is simpler to just
reinit the whole library-renderer-track triplet and library inits
are not that costly anyway.

JSO never uses (non-embedded) memory fonts itself and does not expose
any way to add them so this does not constitute a user-visible change.
Even oct_add_font cannot be used by consumers of upstream JSO binaries.

Note: the JS pointers of the libass handles are updated in this patch,
      but it appears they are actually never used.

Cherry-picked from: libass@6f2bbdb
@dmitrylyzo dmitrylyzo merged commit 3df655a into jellyfin:master Jun 6, 2023
@dmitrylyzo dmitrylyzo deleted the WeebDataHoarder/embedded-fonts branch June 6, 2023 19:41
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.

3 participants