diff options
author | wm4 <wm4@nowhere> | 2012-10-16 07:30:30 +0200 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2012-10-16 07:30:30 +0200 |
commit | 4e89851aa128a614f59ff4885af384a266cb24e6 (patch) | |
tree | c6ab9f34ef3e9c1d58f8ec837b93e249e79bdcf6 /sub/osd_libass.c | |
parent | f45eab6faea05834c1337175dbe51437707b8d7e (diff) | |
parent | 6557f206efeb4569a42f1e4810172bc97fd64619 (diff) | |
download | mpv-4e89851aa128a614f59ff4885af384a266cb24e6.tar.bz2 mpv-4e89851aa128a614f59ff4885af384a266cb24e6.tar.xz |
Merge branch 'master' into osd_changes
Conflicts:
Makefile
command.c
libvo/gl_common.c
libvo/vo_corevideo.m
libvo/vo_opengl.c
libvo/vo_opengl_old.c
libvo/vo_opengl_shaders.glsl
sub/ass_mp.c
sub/osd_libass.c
sub/sd_ass.c
Diffstat (limited to 'sub/osd_libass.c')
-rw-r--r-- | sub/osd_libass.c | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/sub/osd_libass.c b/sub/osd_libass.c index f3296c6091..d77c0d1af2 100644 --- a/sub/osd_libass.c +++ b/sub/osd_libass.c @@ -136,14 +136,6 @@ static char *mangle_ass(const char *in) { char *res = talloc_strdup(NULL, ""); while (*in) { - if (in[0] == '\\' && strchr("nNh{}", in[1])) { - // Undo escaping, e.g. \{ -> \\{ - // Note that e.g. \\j still must be emitted as \\j - // (libass only understands the escapes listed in the strchr args) - res = talloc_asprintf_append_buffer(res, "\\\\%c", in[1]); - in += 2; - continue; - } // As used by osd_get_function_sym(). if (in[0] == '\xFF') { res = talloc_strdup_append_buffer(res, ASS_USE_OSD_FONT); @@ -155,6 +147,9 @@ static char *mangle_ass(const char *in) if (*in == '{') res = talloc_strdup_append_buffer(res, "\\"); res = talloc_strndup_append_buffer(res, in, 1); + // Break ASS escapes with U+2060 WORD JOINER + if (*in == '\\') + append_utf8_buffer(res, 0x2060); in++; } return res; @@ -245,8 +240,10 @@ static void update_sub(struct osd_state *osd, struct osd_object *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_style(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, ""); |