summaryrefslogtreecommitdiffstats
path: root/player
diff options
context:
space:
mode:
authorDudemanguy <random342@airmail.cc>2024-04-02 11:00:28 -0500
committerDudemanguy <random342@airmail.cc>2024-04-02 11:19:25 -0500
commit6179995dd7ef576073e184abd01fd34890e1b59f (patch)
treeffb1cf750141398f7b65389282d6856d327d0f15 /player
parentfe1de116f36be40d65b5a41674fa42667daf1f04 (diff)
downloadmpv-6179995dd7ef576073e184abd01fd34890e1b59f.tar.bz2
mpv-6179995dd7ef576073e184abd01fd34890e1b59f.tar.xz
player/loadfile: set track->forced_select outside of compare_track
This field is used by compare_track when determining if the next track should be preferred. The only problem is that we were only setting this in compare_track which isn't used for the very first subtitle track selection. So if the first subtitle track was a forced track that was selected, this wasn't marked and the next subtitle track could mistakenly be detected as preferred. Fix this by setting the field after we set pick equal to the track in select_default track. Fixes #13804.
Diffstat (limited to 'player')
-rw-r--r--player/loadfile.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/player/loadfile.c b/player/loadfile.c
index b8ccf6723e..44ca805913 100644
--- a/player/loadfile.c
+++ b/player/loadfile.c
@@ -505,7 +505,6 @@ static bool compare_track(struct track *t1, struct track *t2, char **langs, bool
return t1->program_id == preferred_program;
}
int l1 = match_lang(langs, t1->lang), l2 = match_lang(langs, t2->lang);
- t1->forced_select = sub && forced && t1->forced_track;
if (!os_langs && l1 != l2)
return l1 > l2;
if (forced)
@@ -656,6 +655,7 @@ struct track *select_default_track(struct MPContext *mpctx, int order,
(pick && compare_track(track, pick, langs, os_langs, forced, mpctx->opts, preferred_program))))
{
pick = track;
+ pick->forced_select = forced;
}
} else if (!pick || compare_track(track, pick, langs, os_langs, false, mpctx->opts, preferred_program)) {
pick = track;