# HG changeset patch # User alex # Date 1059401851 0 # Node ID db0bc96da95fd0a41def397d5f10ed536ebb7172 # Parent 40df234f2d304a31929d0f4fab9fe1d92eda8c07 1, micro-speedup 2, fixed 10l: only prefer utf8 if iconv is present diff -r 40df234f2d30 -r db0bc96da95f subreader.c --- a/subreader.c Mon Jul 28 02:24:05 2003 +0000 +++ b/subreader.c Mon Jul 28 14:17:31 2003 +0000 @@ -1694,11 +1694,11 @@ // we have a (likely) subtitle file if (found) { int prio = 0; - if (tmp_sub_id) + if (tmp_sub_id && (sub_match_fuzziness >= 1)) { sprintf(tmpresult, "%s %s", f_fname_trim, tmp_sub_id); printf("dvdsublang...%s\n", tmpresult); - if (strcmp(tmp_fname_trim, tmpresult) == 0 && sub_match_fuzziness >= 1) { + if (strcmp(tmp_fname_trim, tmpresult) == 0) { // matches the movie name + lang extension prio = 5; break; @@ -1729,8 +1729,10 @@ if (prio) { prio += prio; +#ifdef USE_ICONV if (i<3) // prefer UTF-8 coded prio++; +#endif sprintf(tmpresult, "%s%s", j == 0 ? f_dir : path, de->d_name); // fprintf(stderr, "%s priority %d\n", tmpresult, prio); if ((f = fopen(tmpresult, "rt"))) {