diff options
author | Uoti Urpala <uau@glyph.nonexistent.invalid> | 2008-12-22 00:16:51 +0200 |
---|---|---|
committer | Uoti Urpala <uau@glyph.nonexistent.invalid> | 2008-12-22 00:46:52 +0200 |
commit | 9afb39ccff089c1269ab3bc7e519897d89b9c7a5 (patch) | |
tree | 707fcdea22923937fbe87b6ce358382c67aed1ef | |
parent | 312d9e4b104741b834aa5d71b02228d0cd988a4e (diff) | |
download | mpv-9afb39ccff089c1269ab3bc7e519897d89b9c7a5.tar.bz2 mpv-9afb39ccff089c1269ab3bc7e519897d89b9c7a5.tar.xz |
libass: If a bad subtitle has multiple \pos use first
Having multiple \pos makes no sense, but such files exist. Apparently
VSFilter uses the values from the first \pos in this case whereas
libass used the last one. Change the behavior to make it compatible
with VSfilter since this has the highest chance of matching what the
creators of the file intended.
-rw-r--r-- | libass/ass_render.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/libass/ass_render.c b/libass/ass_render.c index df75aeb76e..5191f15471 100644 --- a/libass/ass_render.c +++ b/libass/ass_render.c @@ -839,10 +839,15 @@ static char* parse_tag(char* p, double pwr) { v2 = strtol(p, &p, 10); skip(')'); mp_msg(MSGT_ASS, MSGL_DBG2, "pos(%d, %d)\n", v1, v2); - render_context.evt_type = EVENT_POSITIONED; - render_context.detect_collisions = 0; - render_context.pos_x = v1; - render_context.pos_y = v2; + if (render_context.evt_type == EVENT_POSITIONED) { + mp_msg(MSGT_ASS, MSGL_V, "Subtitle has a new \\pos " + "after \\move or \\pos, ignoring\n"); + } else { + render_context.evt_type = EVENT_POSITIONED; + render_context.detect_collisions = 0; + render_context.pos_x = v1; + render_context.pos_y = v2; + } } else if (mystrcmp(&p, "fad")) { int a1, a2, a3; long long t1, t2, t3, t4; |