diff subreader.c @ 10649:857a34ff479d

Fixes FriBiDi support and extends it with configure options. Patch by Raindel Shachar <raindel@techunix.technion.ac.il>
author alex
date Sun, 17 Aug 2003 20:42:06 +0000
parents 39d1e08461da
children 7cb48ef05b02
line wrap: on
line diff
--- a/subreader.c	Sun Aug 17 20:17:03 2003 +0000
+++ b/subreader.c	Sun Aug 17 20:42:06 2003 +0000
@@ -27,6 +27,8 @@
 #endif
 #ifdef USE_FRIBIDI
 #include <fribidi/fribidi.h>
+char *fribidi_charset = NULL;
+int flip_hebrew = 1;
 #endif
 
 extern char* dvdsub_lang;
@@ -1040,11 +1042,12 @@
   int l=sub->lines;
   int char_set_num;
   fribidi_boolean log2vis;
+  if(flip_hebrew) { // Please fix the indentation someday
   fribidi_set_mirroring (FRIBIDI_TRUE);
   fribidi_set_reorder_nsm (FRIBIDI_FALSE);
    
   if( sub_utf8 == 0 ) {
-    char_set_num = fribidi_parse_charset ("ISO8859-8");//We might want to make this a config option
+    char_set_num = fribidi_parse_charset (fribidi_charset?fribidi_charset:"ISO8859-8");
   }else {
     char_set_num = fribidi_parse_charset ("UTF-8");
   }
@@ -1065,7 +1068,6 @@
       len = fribidi_remove_bidi_marks (visual, len, NULL, NULL,
 				       NULL);
       if((op = (char*)malloc(sizeof(char)*(max(2*orig_len,2*len) + 1))) == NULL) {
-      if((op = ALLOCATE(char,(max(2*orig_len,2*len) + 1))) == NULL) {
 	mp_msg(MSGT_SUBREADER,MSGL_WARN,"SUB: error allocating mem.\n");
 	l++;
 	break;	
@@ -1080,6 +1082,7 @@
       free (sub->text[--l]);
     return ERR;
   }
+  }
   return sub;
 }