]> granicus.if.org Git - libass/commitdiff
Warn on \pos, \move redefinitions
authorgreg <greg@blackbox>
Fri, 19 Jun 2009 03:16:30 +0000 (05:16 +0200)
committergreg <greg@blackbox>
Fri, 19 Jun 2009 03:16:30 +0000 (05:16 +0200)
Optionally output a warning when a \pos or \move is redefined in a
single subtitle line.

libass/ass_render.c

index 829716ce229a31f42c21cb4a3520adfeb0e54cfa..f4f4396c41288641981d72ad684c0243857e896c 100644 (file)
@@ -1018,7 +1018,10 @@ static char* parse_tag(char* p, double pwr) {
                mystrtod(&p, &v2);
                skip(')');
                mp_msg(MSGT_ASS, MSGL_DBG2, "pos(%f, %f)\n", v1, v2);
-               if (render_context.evt_type != EVENT_POSITIONED) {
+               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;