diff options
author | Kacper Michajłow <kasper93@gmail.com> | 2024-04-17 18:10:15 +0200 |
---|---|---|
committer | Kacper Michajłow <kasper93@gmail.com> | 2024-05-09 17:12:55 +0200 |
commit | 65c71b164335a6af49591ff775200ca4f274ab6c (patch) | |
tree | 3b05d8fc07e380b47e6ca4a78776316eda3643ae /player/loadfile.c | |
parent | b7216d5d037146bdf6b9d2291bcb3d7344054f52 (diff) | |
download | mpv-65c71b164335a6af49591ff775200ca4f274ab6c.tar.bz2 mpv-65c71b164335a6af49591ff775200ca4f274ab6c.tar.xz |
Revert "loadfile: use mp_match_lang_single"
This reverts commit 76009bf7a6192b9eddc8d4c21a17133bf6352b2b.
Diffstat (limited to 'player/loadfile.c')
-rw-r--r-- | player/loadfile.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/player/loadfile.c b/player/loadfile.c index cfdc445c98..2dbc9c2b94 100644 --- a/player/loadfile.c +++ b/player/loadfile.c @@ -455,9 +455,8 @@ static int match_lang(char **langs, const char *lang) if (!lang) return 0; for (int idx = 0; langs && langs[idx]; idx++) { - int score = mp_match_lang_single(langs[idx], lang); - if (score > 0) - return INT_MAX - (idx + 1) * LANGUAGE_SCORE_MAX + score - 1; + if (lang && strcasecmp(langs[idx], lang) == 0) + return INT_MAX - idx; } return 0; } @@ -617,7 +616,7 @@ struct track *select_default_track(struct MPContext *mpctx, int order, continue; if (sub) { // Subtitle specific auto-selecting crap. - bool audio_matches = mp_match_lang_single(audio_lang, track->lang); + bool audio_matches = audio_lang && track->lang && !strcasecmp(audio_lang, track->lang); bool forced = track->forced_track && (opts->subs_fallback_forced == 2 || (audio_matches && opts->subs_fallback_forced == 1)); bool lang_match = !os_langs && match_lang(langs, track->lang) > 0; |