summaryrefslogtreecommitdiffstats
path: root/player
diff options
context:
space:
mode:
authorDudemanguy <random342@airmail.cc>2023-08-29 12:34:27 -0500
committerDudemanguy <random342@airmail.cc>2023-08-29 12:34:27 -0500
commitdf613cef4c6736c19c4e4be2250936f7dbd74037 (patch)
tree6fd5ea8b3d0c053bbff1dd854dd857b388b0933e /player
parent92fe8f1a4ee97633947417268babaa4a9447301c (diff)
downloadmpv-df613cef4c6736c19c4e4be2250936f7dbd74037.tar.bz2
mpv-df613cef4c6736c19c4e4be2250936f7dbd74037.tar.xz
loadfile: fix --no-subs-with-matching-audio with --slang
If --slang was set to some language and it matched the subtitle track, then --no-subs-with-matching-audio would do nothing. Fix the logic by doing the --no-subs-with-matching-audio step at the end to ensure that it always "wins" over whatever --slang or --subs-fallback has set. Clarify the docs a bit to make it clearer that this is the intended behavior. Fixes fbe8f9919428a7ed24a61899bfd85bbb7680e389.
Diffstat (limited to 'player')
-rw-r--r--player/loadfile.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/player/loadfile.c b/player/loadfile.c
index 3b03878e9a..b9c6786cdc 100644
--- a/player/loadfile.c
+++ b/player/loadfile.c
@@ -663,8 +663,10 @@ struct track *select_default_track(struct MPContext *mpctx, int order,
sub_fallback = (pick->is_external && !pick->no_default) || opts->subs_fallback == 2 ||
(opts->subs_fallback == 1 && pick->default_track);
}
- if (pick && !forced_pick && sub && (!match_lang(langs, pick->lang) || os_langs) &&
- ((!opts->subs_with_matching_audio && audio_matches) || !sub_fallback))
+ if (pick && !forced_pick && sub && (!match_lang(langs, pick->lang) || os_langs) && !sub_fallback)
+ pick = NULL;
+ // Handle this after matching langs and selecting a fallback.
+ if (pick && !forced_pick && sub && (!opts->subs_with_matching_audio && audio_matches))
pick = NULL;
if (pick && pick->attached_picture && !mpctx->opts->audio_display)