summaryrefslogtreecommitdiffstats
path: root/subreader.c
diff options
context:
space:
mode:
authorhenry <henry@b3059339-0415-0410-9bf9-f77b7e298cf2>2003-08-09 16:30:55 +0000
committerhenry <henry@b3059339-0415-0410-9bf9-f77b7e298cf2>2003-08-09 16:30:55 +0000
commit6f99b11486efb588df87a29bb5df0da2fbbd0307 (patch)
tree5c109b57cec0f8ca240a87a98bab74dfd7964793 /subreader.c
parente2e2d40437a8a316b637125d3eb9cf72b52fa4ec (diff)
downloadmpv-6f99b11486efb588df87a29bb5df0da2fbbd0307.tar.bz2
mpv-6f99b11486efb588df87a29bb5df0da2fbbd0307.tar.xz
another attempt to fix the subtitle searching
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@10552 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'subreader.c')
-rw-r--r--subreader.c19
1 files changed, 13 insertions, 6 deletions
diff --git a/subreader.c b/subreader.c
index 1ccc6f0cc1..0b47532100 100644
--- a/subreader.c
+++ b/subreader.c
@@ -1694,14 +1694,20 @@ char** sub_filenames(char* path, char *fname)
// we have a (likely) subtitle file
if (found) {
int prio = 0;
- if (tmp_sub_id && (sub_match_fuzziness >= 1) && (strcmp(tmp_fname_trim, tmpresult) == 0))
+ if (!prio && tmp_sub_id)
{
- // matches the movie name + lang extension
- prio = 5;
- } else if (strcmp(tmp_fname_trim, f_fname_trim) == 0) {
+ 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) {
+ // matches the movie name + lang extension
+ prio = 5;
+ }
+ }
+ if (!prio && strcmp(tmp_fname_trim, f_fname_trim) == 0) {
// matches the movie name
prio = 4;
- } else if ((tmp = strstr(tmp_fname_trim, f_fname_trim)) && (sub_match_fuzziness >= 1)) {
+ }
+ if (!prio && (tmp = strstr(tmp_fname_trim, f_fname_trim)) && (sub_match_fuzziness >= 1)) {
// contains the movie name
tmp += strlen(f_fname_trim);
if (tmp_sub_id && strstr(tmp, tmp_sub_id)) {
@@ -1714,7 +1720,8 @@ char** sub_filenames(char* path, char *fname)
// with no localized subs found, try any else instead
prio = 2;
}
- } else {
+ }
+ if (!prio) {
// doesn't contain the movie name
// don't try in the mplayer subtitle directory
if ((j == 0) && (sub_match_fuzziness >= 2)) {