changeset 36630:70f30c9c35c1

sub_fribidi: Slightly simplify non-fribidi fallback.
author reimar
date Sat, 25 Jan 2014 16:54:55 +0000
parents a94f5085f3a2
children 715567f3387f
files sub/subreader.c
diffstat 1 files changed, 5 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/sub/subreader.c	Sat Jan 25 16:54:54 2014 +0000
+++ b/sub/subreader.c	Sat Jan 25 16:54:55 2014 +0000
@@ -1252,6 +1252,8 @@
   len = fribidi_remove_bidi_marks(visual, len, NULL, NULL, NULL);
   return len;
 }
+#endif
+
 
 /**
  * Do conversion necessary for right-to-left language support via fribidi.
@@ -1259,8 +1261,9 @@
  * @param sub_utf8 whether the subtitle is encoded in UTF-8
  * @param from first new subtitle, all lines before this are assumed to be already converted
  */
-static subtitle* sub_fribidi (subtitle *sub, int sub_utf8, int from)
+static subtitle* sub_fribidi (subtitle *sub, int av_unused sub_utf8, int av_unused from)
 {
+#ifdef CONFIG_FRIBIDI
   FriBidiChar logical[LINE_LEN+1], visual[LINE_LEN+1]; // Hopefully these two won't smash the stack
   char        *ip      = NULL, *op     = NULL;
   size_t len,orig_len;
@@ -1304,11 +1307,10 @@
     sub->lines = 0;
     return ERR;
   }
+#endif
   return sub;
 }
 
-#endif
-
 static void adjust_subs_time(subtitle* sub, float subtime, float fps, int block,
                              int sub_num, int sub_uses_time) {
 	int n,m;
@@ -1526,9 +1528,7 @@
 #ifdef CONFIG_ICONV
 	if ((sub!=ERR) && sub_utf8 == 2 && utf16 == 0) sub=subcp_recode(sub);
 #endif
-#ifdef CONFIG_FRIBIDI
 	if (sub!=ERR) sub=sub_fribidi(sub,sub_utf8,0);
-#endif
 	if ( sub == ERR )
 	 {
 #ifdef CONFIG_ICONV
@@ -2583,10 +2583,8 @@
             sub->endpts[sub->lines]);
     free(sub->text[sub->lines]);
   }
-#ifdef CONFIG_FRIBIDI
   if (strip_markup)
   sub = sub_fribidi(sub, sub_utf8, orig_lines);
-#endif
 }
 
 #define MP_NOPTS_VALUE (-1LL<<63)