# HG changeset patch # User reimar # Date 1390668895 0 # Node ID 70f30c9c35c174c56655c762ee731636630ecd5a # Parent a94f5085f3a290d070f39555f8ef345d839ec24c sub_fribidi: Slightly simplify non-fribidi fallback. diff -r a94f5085f3a2 -r 70f30c9c35c1 sub/subreader.c --- 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)