diff options
author | wm4 <wm4@nowhere> | 2012-08-07 19:21:46 +0200 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2012-08-07 19:21:46 +0200 |
commit | fb563de2550858f9ae6cdb239d44a415e5e91135 (patch) | |
tree | 53d87a7af290a1a40b33d70c060d4137114fd0d2 /sub/osd_libass.c | |
parent | 762ef8d53238160d5fc8873c249d11d38399bf94 (diff) | |
download | mpv-fb563de2550858f9ae6cdb239d44a415e5e91135.tar.bz2 mpv-fb563de2550858f9ae6cdb239d44a415e5e91135.tar.xz |
sub: fix confusion of ass_library handles
Commit 7484ae8e2ee5327 attempted to introduce two ass_library handles
(as it was needed to deal with how ass_library manages fonts), but the
commit was completely bogus: it assumed osd_state->ass_library would be
used by osd_libass.c only, which is not the case. As result, some of the
subtitle code used the wrong ass_library handle.
We need two ass_library handles in osd_state. The one from the mplayer
core for subtitles (osd_state->ass_library), and one for OSD rendering
(osd_state->osd_ass_library).
Diffstat (limited to 'sub/osd_libass.c')
-rw-r--r-- | sub/osd_libass.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/sub/osd_libass.c b/sub/osd_libass.c index 3f6564fbca..3e6c9a872a 100644 --- a/sub/osd_libass.c +++ b/sub/osd_libass.c @@ -44,11 +44,11 @@ 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, + osd->osd_ass_library = mp_ass_init(osd->opts); + ass_add_font(osd->osd_ass_library, "OSD", (void *)osd_font_pfb, sizeof(osd_font_pfb) - 1); - osd->osd_render = ass_renderer_init(osd->ass_library); + osd->osd_render = ass_renderer_init(osd->osd_ass_library); mp_ass_configure_fonts(osd->osd_render); ass_set_aspect_ratio(osd->osd_render, 1.0, 1.0); } @@ -59,8 +59,8 @@ void osd_destroy_backend(struct osd_state *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; + ass_library_done(osd->osd_ass_library); + osd->osd_ass_library = NULL; } } @@ -185,7 +185,7 @@ static void update_font_scale(ASS_Track *track, ASS_Style *style, double factor) static ASS_Track *create_osd_ass_track(struct osd_state *osd) { - ASS_Track *track = mp_ass_default_track(osd->ass_library, osd->opts); + ASS_Track *track = mp_ass_default_track(osd->osd_ass_library, osd->opts); ASS_Style *style = track->styles + track->default_style; track->PlayResX = track->PlayResY * 1.33333; @@ -344,7 +344,7 @@ void vo_update_text_sub(struct osd_state *osd, mp_osd_obj_t* obj) } if (!obj->osd_track) - obj->osd_track = mp_ass_default_track(osd->ass_library, osd->opts); + obj->osd_track = mp_ass_default_track(osd->osd_ass_library, osd->opts); ASS_Style *style = obj->osd_track->styles + obj->osd_track->default_style; |