]> granicus.if.org Git - libass/commitdiff
Skip both newline and carriage return.
authorReimar Döffinger <Reimar.Doeffinger@gmx.de>
Tue, 24 Sep 2013 20:28:15 +0000 (22:28 +0200)
committerwm4 <wm4@nowhere>
Wed, 25 Sep 2013 15:54:20 +0000 (17:54 +0200)
'\r' characters weren't skipped correctly.

SKIP_SYMBOL from original patch renamed to IS_SKIP_SYMBOL.

Signed-off-by: wm4 <wm4@nowhere>
libass/ass_render.c

index 45d88bbe1fc13fa35eec0f691029ff49c11f8376..0cf1f16f83b9bf02e040d4ca1359729be6b920b3 100644 (file)
@@ -682,6 +682,8 @@ blend_vector_exit:
     render_priv->state.clip_drawing = 0;
 }
 
+#define IS_SKIP_SYMBOL(x) ((x) == 0 || (x) == '\n' || (x) == '\r')
+
 /**
  * \brief Convert TextInfo struct to ASS_Image list
  * Splits glyphs in halves when needed (for \kf karaoke).
@@ -699,7 +701,7 @@ static ASS_Image *render_text(ASS_Renderer *render_priv, int dst_x, int dst_y)
 
     for (i = 0; i < text_info->length; ++i) {
         GlyphInfo *info = text_info->glyphs + i;
-        if ((info->symbol == 0) || (info->symbol == '\n') || !info->bm_s
+        if (IS_SKIP_SYMBOL(info->symbol) || !info->bm_s
             || (info->shadow_x == 0 && info->shadow_y == 0) || info->skip)
             continue;
 
@@ -733,7 +735,7 @@ static ASS_Image *render_text(ASS_Renderer *render_priv, int dst_x, int dst_y)
     last_tail = 0;
     for (i = 0; i < text_info->length; ++i) {
         GlyphInfo *info = text_info->glyphs + i;
-        if ((info->symbol == 0) || (info->symbol == '\n') || !info->bm_o
+        if (IS_SKIP_SYMBOL(info->symbol) || !info->bm_o
             || info->skip)
             continue;
 
@@ -766,7 +768,7 @@ static ASS_Image *render_text(ASS_Renderer *render_priv, int dst_x, int dst_y)
 
     for (i = 0; i < text_info->length; ++i) {
         GlyphInfo *info = text_info->glyphs + i;
-        if ((info->symbol == 0) || (info->symbol == '\n') || !info->bm
+        if (IS_SKIP_SYMBOL(info->symbol) || !info->bm
             || info->skip)
             continue;