changeset 34549:da8125c9ecad

Do not try to render \r. Sample: http://samples.mplayerhq.hu/sub/fribidi/fribidi_arabic_hebrew_subs.mkv with -sid 0.
author reimar
date Sat, 28 Jan 2012 14:51:29 +0000
parents 215379500aac
children 41574d60dc98
files libass/ass_render.c
diffstat 1 files changed, 5 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/libass/ass_render.c	Sat Jan 28 14:24:59 2012 +0000
+++ b/libass/ass_render.c	Sat Jan 28 14:51:29 2012 +0000
@@ -683,6 +683,8 @@
     render_priv->state.clip_drawing = 0;
 }
 
+#define 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).
@@ -700,7 +702,7 @@
 
     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 (SKIP_SYMBOL(info->symbol) || !info->bm_s
             || (info->shadow_x == 0 && info->shadow_y == 0) || info->skip)
             continue;
 
@@ -734,7 +736,7 @@
     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 (SKIP_SYMBOL(info->symbol) || !info->bm_o
             || info->skip)
             continue;
 
@@ -767,7 +769,7 @@
 
     for (i = 0; i < text_info->length; ++i) {
         GlyphInfo *info = text_info->glyphs + i;
-        if ((info->symbol == 0) || (info->symbol == '\n') || !info->bm
+        if (SKIP_SYMBOL(info->symbol) || !info->bm
             || info->skip)
             continue;