1, micro-speedup 2, fixed 10l: only prefer utf8 if iconv is present

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@10495 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
alex 2003-07-28 14:17:31 +00:00
parent 36898c322b
commit 05e09adb9f
1 changed files with 4 additions and 2 deletions

View File

@ -1694,11 +1694,11 @@ char** sub_filenames(char* path, char *fname)
// we have a (likely) subtitle file // we have a (likely) subtitle file
if (found) { if (found) {
int prio = 0; 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); sprintf(tmpresult, "%s %s", f_fname_trim, tmp_sub_id);
printf("dvdsublang...%s\n", tmpresult); 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 // matches the movie name + lang extension
prio = 5; prio = 5;
break; break;
@ -1729,8 +1729,10 @@ char** sub_filenames(char* path, char *fname)
if (prio) { if (prio) {
prio += prio; prio += prio;
#ifdef USE_ICONV
if (i<3) // prefer UTF-8 coded if (i<3) // prefer UTF-8 coded
prio++; prio++;
#endif
sprintf(tmpresult, "%s%s", j == 0 ? f_dir : path, de->d_name); sprintf(tmpresult, "%s%s", j == 0 ? f_dir : path, de->d_name);
// fprintf(stderr, "%s priority %d\n", tmpresult, prio); // fprintf(stderr, "%s priority %d\n", tmpresult, prio);
if ((f = fopen(tmpresult, "rt"))) { if ((f = fopen(tmpresult, "rt"))) {