summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2013-06-30 18:46:29 +0200
committerwm4 <wm4@nowhere>2013-07-15 02:01:37 +0200
commit169b3abd788ac566b4ba831bbcc0dfd3c8981fd0 (patch)
treebfe9b13a37a4b52ec2fcac324d81a28dc8096fa4
parentaf55db654b9156879b89d92306a17fb847713792 (diff)
downloadmpv-169b3abd788ac566b4ba831bbcc0dfd3c8981fd0.tar.bz2
mpv-169b3abd788ac566b4ba831bbcc0dfd3c8981fd0.tar.xz
sd_ass: scale blur by original video size if requested
-rw-r--r--DOCS/man/en/options.rst11
-rw-r--r--core/options.c2
-rw-r--r--core/options.h1
-rw-r--r--sub/sd_ass.c9
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);