summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorReimar Döffinger <Reimar.Doeffinger@gmx.de>2013-09-24 22:28:15 +0200
committerwm4 <wm4@nowhere>2013-09-25 17:54:20 +0200
commit9b48357234806a4fe29ec97eba6c998a26033b5d (patch)
tree5732c0116e3ef625b8d2c3b4d20dcd3a3e1a8148
parent05eb520f431e73c2ad19a8e0261f35d396545cf9 (diff)
downloadlibass-9b48357234806a4fe29ec97eba6c998a26033b5d.tar.bz2
libass-9b48357234806a4fe29ec97eba6c998a26033b5d.tar.xz
Skip both newline and carriage return.
'\r' characters weren't skipped correctly. SKIP_SYMBOL from original patch renamed to IS_SKIP_SYMBOL. Signed-off-by: wm4 <wm4@nowhere>
-rw-r--r--libass/ass_render.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/libass/ass_render.c b/libass/ass_render.c
index 45d88bb..0cf1f16 100644
--- a/libass/ass_render.c
+++ b/libass/ass_render.c
@@ -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;