summaryrefslogtreecommitdiffstats
path: root/player/loadfile.c
diff options
context:
space:
mode:
authorDudemanguy <random342@airmail.cc>2023-12-28 10:16:42 -0600
committerDudemanguy <random342@airmail.cc>2024-01-13 03:26:06 +0000
commit2ad96079e99b33e24c912f9b2f5129c1309abede (patch)
treedd297b38b4b967122e56b29869e22fd55b1d5e4d /player/loadfile.c
parent871f7a152a3f0b3561a627d21f7417d10ac9c25c (diff)
downloadmpv-2ad96079e99b33e24c912f9b2f5129c1309abede.tar.bz2
mpv-2ad96079e99b33e24c912f9b2f5129c1309abede.tar.xz
player: add forced choice to subs-with-matching-audio
fe875083b3d30b06ef77745f40570e8f63afec2 confused things a bit and made --no-subs-with-matching-audio actually mean what it says: no subtitles if the languages match. However, the option actually meant no non-forced subtitles not no subtitles at all. This isn't really intuitive so instead of changing the behavior back to the old way (we already have a release since then), add a third option "forced" which is equivalent to the old meaning of --no-subs-with-matching audio. Fixes #13151.
Diffstat (limited to 'player/loadfile.c')
-rw-r--r--player/loadfile.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/player/loadfile.c b/player/loadfile.c
index 1d25dc340a..4bd5a110aa 100644
--- a/player/loadfile.c
+++ b/player/loadfile.c
@@ -673,9 +673,12 @@ struct track *select_default_track(struct MPContext *mpctx, int order,
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 && sub && (!opts->subs_with_matching_audio && audio_matches))
+ if (pick && sub && ((!opts->subs_with_matching_audio && audio_matches) ||
+ (opts->subs_with_matching_audio == 1 && audio_matches && !forced_pick)))
+ {
pick = NULL;
- // Handle edge cases if we picked a track that doesn't match the --subs-fallback-force value
+ }
+ // Handle edge cases if we picked a track that doesn't match the --subs-fallback-forced value
if (pick && sub && ((!pick->forced_track && opts->subs_fallback_forced == 2) ||
(pick->forced_track && !opts->subs_fallback_forced)))
{