]> granicus.if.org Git - libass/commitdiff
Fix \k and \ko tags
authorGrigori Goronzy <greg@blackbox>
Tue, 28 Jul 2009 09:05:26 +0000 (11:05 +0200)
committerGrigori Goronzy <greg@blackbox>
Tue, 28 Jul 2009 09:05:26 +0000 (11:05 +0200)
The timing calculations for \k and \ko were off and still assumed
int values for a bbox, while it now uses a d6 representation.
This essentially made duration about 64 times as long as it should be.

libass/ass_render.c

index 418fceb3084acfdeed142e55e2a876b22d66cfc3..8c2a40815ed8f945f0bfb1db5d16a00ebafd9cb1 100644 (file)
@@ -891,7 +891,7 @@ static ass_image_t *render_text(ass_renderer_t *render_priv, int dst_x,
         bm = info->bm_o;
 
         if ((info->effect_type == EF_KARAOKE_KO)
-            && (info->effect_timing <= info->bbox.xMax)) {
+            && (info->effect_timing <= d6_to_int(info->bbox.xMax))) {
             // do nothing
         } else {
             here_tail = tail;
@@ -916,7 +916,7 @@ static ass_image_t *render_text(ass_renderer_t *render_priv, int dst_x,
 
         if ((info->effect_type == EF_KARAOKE)
             || (info->effect_type == EF_KARAOKE_KO)) {
-            if (info->effect_timing > info->bbox.xMax)
+            if (info->effect_timing > d6_to_int(info->bbox.xMax))
                 tail =
                     render_glyph(render_priv, bm, pen_x, pen_y,
                                  info->c[0], 0, 1000000, tail);