From 3a8058658d3c0fadc607460d0411bbdea55a8edb Mon Sep 17 00:00:00 2001 From: wm4 Date: Sat, 30 Apr 2016 14:25:23 +0200 Subject: [PATCH] sd_add: replace --sub-ass=no with --ass-style-override=strip --sub-ass=no / --ass=no still work, but --ass-style-override=strip is preferred now. With this change, --ass-style-override can control all the types of style overriding. --- DOCS/interface-changes.rst | 2 ++ DOCS/man/options.rst | 15 ++++++++++----- options/options.c | 2 +- sub/sd_ass.c | 3 ++- 4 files changed, 15 insertions(+), 7 deletions(-) diff --git a/DOCS/interface-changes.rst b/DOCS/interface-changes.rst index 3be16933ba..d1d8d870e2 100644 --- a/DOCS/interface-changes.rst +++ b/DOCS/interface-changes.rst @@ -23,6 +23,8 @@ Interface changes - now ab-loops are active even if one of the "ab-loop-a"/"-b" properties is unset ("no"), in which case the start of the file is used if the A loop point is unsert, and the end of the file for an unset B loop point + - deprecate --sub-ass=no option by --ass-style-override=strip + (also needs --embeddedfonts=no) --- mpv 0.17.0 --- - deprecate "track-list/N/audio-channels" property (use "track-list/N/demux-channel-count" instead) diff --git a/DOCS/man/options.rst b/DOCS/man/options.rst index f7f92caabf..bb92133396 100644 --- a/DOCS/man/options.rst +++ b/DOCS/man/options.rst @@ -1429,7 +1429,7 @@ Subtitles 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 @@ -1439,6 +1439,8 @@ Subtitles :no: Render subtitles as forced by subtitle scripts. :force: Try to force the font style as defined by the ``--sub-text-*`` options. Can break rendering easily. + :strip: Radically strip all ASS tags and styles from the subtitle. This + is equivalent to the old ``--no-ass`` / ``--no-sub-ass`` options. ``--ass-force-margins`` Enables placing toptitles and subtitles in black borders when they are @@ -1535,6 +1537,13 @@ Subtitles ``--sub-ass``, ``--no-sub-ass`` Render ASS subtitles natively (enabled by default). + .. note:: + + This has been deprecated by ``--ass-style-override=strip``. You also + may need ``--embeddedfonts=no`` to get the same behavior. Also, + using ``--ass-style-override=force`` should give better results + without breaking subtitles too much. + If ``--no-sub-ass`` is specified, all tags and style declarations are stripped and ignored on display. The subtitle renderer uses the font style as specified by the ``--sub-text-`` options instead. @@ -1545,10 +1554,6 @@ Subtitles rendering of ASS/SSA subtitles. It can sometimes be useful to forcibly override the styling of ASS subtitles, but should be avoided in general. - .. note:: - - Try using ``--ass-style-override=force`` instead. - ``--sub-auto=``, ``--no-sub-auto`` Load additional subtitle files matching the video filename. The parameter specifies how external subtitle files are matched. ``exact`` is enabled by diff --git a/options/options.c b/options/options.c index 90a72ee7c3..30ae218ba2 100644 --- a/options/options.c +++ b/options/options.c @@ -374,7 +374,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", 3}, {"signfs", 4})), + ({"no", 0}, {"yes", 1}, {"force", 3}, {"signfs", 4}, {"strip", 5})), OPT_FLAG("sub-scale-by-window", sub_scale_by_window, 0), OPT_FLAG("sub-scale-with-window", sub_scale_with_window, 0), OPT_FLAG("ass-scale-with-window", ass_scale_with_window, 0), diff --git a/sub/sd_ass.c b/sub/sd_ass.c index 788b78f3a4..e52795f7eb 100644 --- a/sub/sd_ass.c +++ b/sub/sd_ass.c @@ -422,7 +422,8 @@ static void get_bitmaps(struct sd *sd, struct mp_osd_res dim, double pts, { struct sd_ass_priv *ctx = sd->priv; struct MPOpts *opts = sd->opts; - bool no_ass = !opts->ass_enabled || ctx->on_top; + bool no_ass = !opts->ass_enabled || ctx->on_top || + opts->ass_style_override == 5; bool converted = ctx->is_converted || no_ass; ASS_Track *track = no_ass ? ctx->shadow_track : ctx->ass_track; ASS_Renderer *renderer = ctx->ass_renderer;