summaryrefslogtreecommitdiffstats
path: root/sub/ass_mp.c
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2012-10-11 02:23:22 +0200
committerwm4 <wm4@nowhere>2012-10-12 10:13:42 +0200
commit2f6713bedeb77a7c058ce4954eb95ee7a2ca7119 (patch)
tree73e81b299e118384394c6bf13f78f4527e6d304c /sub/ass_mp.c
parentfd56c168aedb41a7d98dc4af32644d970eb81331 (diff)
downloadmpv-2f6713bedeb77a7c058ce4954eb95ee7a2ca7119.tar.bz2
mpv-2f6713bedeb77a7c058ce4954eb95ee7a2ca7119.tar.xz
sub: enable sub-pos with libass
The --sub-pos option and sub-pos property control the vertical position of a subtitle. Also change how sub-pos is handled in the old subtitle renderer (used with -no-ass). The new behavior doesn't render subtitles out of the screen if the subtitle is located near the top screen border and has too many lines.
Diffstat (limited to 'sub/ass_mp.c')
-rw-r--r--sub/ass_mp.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/sub/ass_mp.c b/sub/ass_mp.c
index 202664578b..e2729df8ca 100644
--- a/sub/ass_mp.c
+++ b/sub/ass_mp.c
@@ -232,6 +232,9 @@ void mp_ass_configure(ASS_Renderer *priv, struct MPOpts *opts,
ass_set_frame_size(priv, dim->w, dim->h);
ass_set_margins(priv, dim->mt, dim->mb, dim->ml, dim->mr);
ass_set_use_margins(priv, opts->ass_use_margins);
+#if LIBASS_VERSION >= 0x01010000
+ ass_set_line_position(priv, 100 - sub_pos);
+#endif
ass_set_font_scale(priv, opts->ass_font_scale);
if (!unscaled && (opts->ass_hinting & 4))
hinting = 0;