From b4c1699aafc7be95d06d0c5936d2b77234d2ec2d Mon Sep 17 00:00:00 2001 From: wm4 Date: Thu, 5 Jun 2014 01:10:48 +0200 Subject: sub: remove old style override option Didn't work too well. --- DOCS/man/en/options.rst | 7 +------ options/options.c | 2 +- sub/sd_ass.c | 27 --------------------------- 3 files changed, 2 insertions(+), 34 deletions(-) diff --git a/DOCS/man/en/options.rst b/DOCS/man/en/options.rst index fac446c0ba..6504da8c9e 100644 --- a/DOCS/man/en/options.rst +++ b/DOCS/man/en/options.rst @@ -162,18 +162,13 @@ OPTIONS Using this option may lead to incorrect subtitle rendering. -``--ass-style-override=`` +``--ass-style-override=`` Control whether user style overrides should be applied. :yes: Apply all the ``--ass-*`` style override options. Changing the default for any of these options can lead to incorrect subtitle rendering (default). :no: Render subtitles as forced by subtitle scripts. - :force-default: Like ``yes``, but also override the style named ``Default`` - to make it look like the like text subtitle style implied by the - ``--sub-text-...`` option. This won't always work, because the - dialogue style doesn't necessary use this name, and it might break - other advanced uses of the ASS format. :force: Try to force the font style as defined by the ``--sub-text-*`` options. Requires a modified libass, can break rendering easily. Probably more reliable than ``force``. diff --git a/options/options.c b/options/options.c index cb0ddd9c30..3cebd0c5fd 100644 --- a/options/options.c +++ b/options/options.c @@ -427,7 +427,7 @@ const m_option_t mp_opts[] = { OPT_CHOICE("ass-shaper", ass_shaper, 0, ({"simple", 0}, {"complex", 1})), OPT_CHOICE("ass-style-override", ass_style_override, 0, - ({"no", 0}, {"yes", 1}, {"force-default", 2}, {"force", 3})), + ({"no", 0}, {"yes", 1}, {"force", 3})), OPT_FLAG("osd-bar", osd_bar_visible, 0), OPT_FLOATRANGE("osd-bar-align-x", osd_bar_align_x, 0, -1.0, +1.0), OPT_FLOATRANGE("osd-bar-align-y", osd_bar_align_y, 0, -1.0, +1.0), diff --git a/sub/sd_ass.c b/sub/sd_ass.c index d29fefd277..51b9472198 100644 --- a/sub/sd_ass.c +++ b/sub/sd_ass.c @@ -124,16 +124,6 @@ static void decode(struct sd *sd, struct demux_packet *packet) event->Text = strdup(text); } -static ASS_Style *find_style(ASS_Track *track, const char *name) -{ - for (int n = track->n_styles - 1; n >= 0; n--) { - const char *style_name = track->styles[n].Name; - if (style_name && strcasecmp(style_name, name) == 0) - return &track->styles[n]; - } - return NULL; -} - static void get_bitmaps(struct sd *sd, struct mp_osd_res dim, double pts, struct sub_bitmaps *res) { @@ -143,18 +133,6 @@ static void get_bitmaps(struct sd *sd, struct mp_osd_res dim, double pts, if (pts == MP_NOPTS_VALUE || !sd->ass_renderer) return; - ASS_Style prev_default_style; - ASS_Style *default_style = NULL; - if (opts->ass_style_override == 2) { - default_style = find_style(ctx->ass_track, "Default"); - if (default_style) { - prev_default_style = *default_style; - default_style->FontName = NULL; // don't free this - mp_ass_set_style(default_style, ctx->ass_track->PlayResY, - opts->sub_text_style); - } - } - ASS_Renderer *renderer = sd->ass_renderer; double scale = dim.display_par; if (!ctx->is_converted && (!opts->ass_style_override || @@ -184,11 +162,6 @@ static void get_bitmaps(struct sd *sd, struct mp_osd_res dim, double pts, if (!ctx->is_converted) mangle_colors(sd, res); - - if (default_style) { - free(default_style->FontName); - *default_style = prev_default_style; - } } struct buf { -- cgit v1.2.3