sub: remove old style override option

Didn't work too well.
This commit is contained in:
wm4 2014-06-05 01:10:48 +02:00
parent 015399f696
commit b4c1699aaf
3 changed files with 2 additions and 34 deletions

View File

@ -162,18 +162,13 @@ OPTIONS
Using this option may lead to incorrect subtitle rendering.
``--ass-style-override=<yes|no|force|force-default>``
``--ass-style-override=<yes|no|force>``
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``.

View File

@ -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),

View File

@ -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 {