summaryrefslogtreecommitdiffstats
path: root/sub/osd_libass.c
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2012-08-07 02:12:15 +0200
committerwm4 <wm4@nowhere>2012-08-07 02:15:27 +0200
commit7484ae8e2ee5327400358e7c7cb974d84543aef6 (patch)
treee93ae04b40b0bf7e686ed61e25b6a056b8ba57f6 /sub/osd_libass.c
parent0268b1a44562ea5310491fbcbb987d5462f42ca5 (diff)
downloadmpv-7484ae8e2ee5327400358e7c7cb974d84543aef6.tar.bz2
mpv-7484ae8e2ee5327400358e7c7cb974d84543aef6.tar.xz
osd_libass: allocate separate ASS_Library for OSD
osd_libass.c used the same ASS_Library object as the player core. This caused a problem: when playing a new file, all fonts loaded by the ASS_Library object were unloaded, including the OSD font. Parts of the OSD would stop being rendered correctly. Solve this by creating a separate ASS_Library, with its own set of fonts.
Diffstat (limited to 'sub/osd_libass.c')
-rw-r--r--sub/osd_libass.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/sub/osd_libass.c b/sub/osd_libass.c
index 03ab9b55dd..3f6564fbca 100644
--- a/sub/osd_libass.c
+++ b/sub/osd_libass.c
@@ -44,6 +44,7 @@ static const char osd_font_pfb[] =
void osd_init_backend(struct osd_state *osd)
{
+ osd->ass_library = mp_ass_init(osd->opts);
ass_add_font(osd->ass_library, "OSD", (void *)osd_font_pfb,
sizeof(osd_font_pfb) - 1);
@@ -54,9 +55,12 @@ void osd_init_backend(struct osd_state *osd)
void osd_destroy_backend(struct osd_state *osd)
{
- if (osd && osd->osd_render) {
- ass_renderer_done(osd->osd_render);
+ if (osd) {
+ if (osd->osd_render)
+ ass_renderer_done(osd->osd_render);
osd->osd_render = NULL;
+ ass_library_done(osd->ass_library);
+ osd->ass_library = NULL;
}
}