From 9afb39ccff089c1269ab3bc7e519897d89b9c7a5 Mon Sep 17 00:00:00 2001 From: Uoti Urpala Date: Mon, 22 Dec 2008 00:16:51 +0200 Subject: 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. --- libass/ass_render.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'libass') 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; -- cgit v1.2.3