summaryrefslogtreecommitdiffstats
path: root/subreader.c
diff options
context:
space:
mode:
authoralex <alex@b3059339-0415-0410-9bf9-f77b7e298cf2>2003-08-17 20:42:06 +0000
committeralex <alex@b3059339-0415-0410-9bf9-f77b7e298cf2>2003-08-17 20:42:06 +0000
commitf6ecfe741f18a62cc33157193aed35ee695cfa68 (patch)
tree418b399188c6974ee357ed1e011e5674f8b866fc /subreader.c
parentd1b85029f820f6d6abe9ad254d8364392af2e826 (diff)
downloadmpv-f6ecfe741f18a62cc33157193aed35ee695cfa68.tar.bz2
mpv-f6ecfe741f18a62cc33157193aed35ee695cfa68.tar.xz
Fixes FriBiDi support and extends it with configure options. Patch by Raindel Shachar <raindel@techunix.technion.ac.il>
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@10650 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'subreader.c')
-rw-r--r--subreader.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/subreader.c b/subreader.c
index 804436f6bd..de618c1af0 100644
--- a/subreader.c
+++ b/subreader.c
@@ -27,6 +27,8 @@ char *sub_cp=NULL;
#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 @@ subtitle* sub_fribidi (subtitle *sub, int sub_utf8)
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 @@ subtitle* sub_fribidi (subtitle *sub, int sub_utf8)
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 @@ subtitle* sub_fribidi (subtitle *sub, int sub_utf8)
free (sub->text[--l]);
return ERR;
}
+ }
return sub;
}