From 2b990ac8105f500aafc43b617eb35d474f1c5107 Mon Sep 17 00:00:00 2001 From: wm4 Date: Sun, 29 Nov 2015 13:50:51 +0100 Subject: osd: fix and cleanup font style management Commit 2b07d3eb merged progbar and OSD text renderer into one ASS_Track, but it confused the styles. Specifically, if both progbar and OSD are visible, the create_ass_track() call made by the progbar code will reset the style adjusted by the OSD text code. Change create_ass_track() not to add any styles. Instead let the caller manage the styles. They are now referenced by name, and lazily added if they don't exist yet. This is also much cleaner. --- sub/ass_mp.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'sub/ass_mp.c') diff --git a/sub/ass_mp.c b/sub/ass_mp.c index a3a7c73cd3..df32d17ce6 100644 --- a/sub/ass_mp.c +++ b/sub/ass_mp.c @@ -40,6 +40,9 @@ void mp_ass_set_style(ASS_Style *style, double res_y, const struct osd_style_opts *opts) { + if (!style) + return; + if (opts->font) { if (!style->FontName || strcmp(style->FontName, opts->font) != 0) { free(style->FontName); -- cgit v1.2.3