diff options
-rw-r--r-- | DOCS/man/en/options.rst | 11 | ||||
-rw-r--r-- | core/options.c | 2 | ||||
-rw-r--r-- | core/options.h | 1 | ||||
-rw-r--r-- | sub/sd_ass.c | 9 |
4 files changed, 22 insertions, 1 deletions
diff --git a/DOCS/man/en/options.rst b/DOCS/man/en/options.rst index ad463daffc..bb908f3885 100644 --- a/DOCS/man/en/options.rst +++ b/DOCS/man/en/options.rst @@ -157,7 +157,7 @@ Enables placing toptitles and subtitles in black borders when they are available. -``--ass-vsfilter-aspect-compat`` +``--ass-vsfilter-aspect-compat=<yes|no>`` Stretch SSA/ASS subtitles when playing anamorphic videos for compatibility with traditional VSFilter behavior. This switch has no effect when the video is stored with square pixels. @@ -174,6 +174,15 @@ Enabled by default. +``--ass-vsfilter-blur-compat=<yes|no>`` + Scale ``\blur`` tags by video resolution instead of script resolution + (enabled by default). This is bug in VSFilter, which according to some, + can't be fixed anymore in the name of compatibility. + + Note that this uses the actual video resolution for calculating the + offset scale factor, not what the video filter chain or the video output + use. + ``--ass-vsfilter-color-compat=<basic|full|force-601|no`` Mangle colors like (xy-)vsfilter do (default: basic). Historically, VSFilter was not colorspace aware. This was no problem as long as the colorspace diff --git a/core/options.c b/core/options.c index 09b2f4aad6..1eeb2e6914 100644 --- a/core/options.c +++ b/core/options.c @@ -502,6 +502,7 @@ const m_option_t mp_opts[] = { OPT_FLAG("ass-vsfilter-aspect-compat", ass_vsfilter_aspect_compat, 0), OPT_CHOICE("ass-vsfilter-color-compat", ass_vsfilter_color_compat, 0, ({"no", 0}, {"basic", 1}, {"full", 2}, {"force-601", 3})), + OPT_FLAG("ass-vsfilter-blur-compat", ass_vsfilter_blur_compat, 0), OPT_FLAG("embeddedfonts", use_embedded_fonts, 0), OPT_STRINGLIST("ass-force-style", ass_force_style_list, 0), OPT_STRING("ass-styles", ass_styles_file, 0), @@ -794,6 +795,7 @@ const struct MPOpts mp_default_opts = { .sub_scale = 1, .ass_vsfilter_aspect_compat = 1, .ass_vsfilter_color_compat = 1, + .ass_vsfilter_blur_compat = 1, .ass_style_override = 1, .use_embedded_fonts = 1, .suboverlap_enabled = 0, diff --git a/core/options.h b/core/options.h index cfc786262e..8fe6c231b1 100644 --- a/core/options.h +++ b/core/options.h @@ -191,6 +191,7 @@ typedef struct MPOpts { int ass_use_margins; int ass_vsfilter_aspect_compat; int ass_vsfilter_color_compat; + int ass_vsfilter_blur_compat; int use_embedded_fonts; char **ass_force_style_list; char *ass_styles_file; diff --git a/sub/sd_ass.c b/sub/sd_ass.c index 8091a163b4..52c05021d3 100644 --- a/sub/sd_ass.c +++ b/sub/sd_ass.c @@ -196,6 +196,15 @@ static void get_bitmaps(struct sd *sd, struct mp_osd_res dim, double pts, scale = scale * dim.video_par; mp_ass_configure(renderer, opts, &dim); ass_set_aspect_ratio(renderer, scale, 1); +#if LIBASS_VERSION >= 0x01020000 + if (!ctx->is_converted && (!opts->ass_style_override || + opts->ass_vsfilter_blur_compat)) + { + ass_set_storage_size(renderer, ctx->video_params.w, ctx->video_params.h); + } else { + ass_set_storage_size(renderer, 0, 0); + } +#endif mp_ass_render_frame(renderer, ctx->ass_track, pts * 1000 + .5, &ctx->parts, res); talloc_steal(ctx, ctx->parts); |