diff options
author | wm4 <wm4@nowhere> | 2012-10-11 02:23:22 +0200 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2012-10-12 10:13:42 +0200 |
commit | 2f6713bedeb77a7c058ce4954eb95ee7a2ca7119 (patch) | |
tree | 73e81b299e118384394c6bf13f78f4527e6d304c /sub/osd_libass.c | |
parent | fd56c168aedb41a7d98dc4af32644d970eb81331 (diff) | |
download | mpv-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/osd_libass.c')
-rw-r--r-- | sub/osd_libass.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/sub/osd_libass.c b/sub/osd_libass.c index e770215ce6..9b0bbb01ab 100644 --- a/sub/osd_libass.c +++ b/sub/osd_libass.c @@ -345,8 +345,10 @@ void vo_update_text_sub(struct osd_state *osd, mp_osd_obj_t* obj) ASS_Style *style = obj->osd_track->styles + obj->osd_track->default_style; - style->MarginV = obj->osd_track->PlayResY * ((100 - sub_pos)/110.0); update_font_scale(obj->osd_track, style, text_font_scale_factor); +#if LIBASS_VERSION >= 0x01010000 + ass_set_line_position(osd->osd_render, 100 - sub_pos); +#endif char *text = talloc_strdup(NULL, ""); |