player/loadfile: clean up track comparison logic
This brings compare_track closer to implementing a consistent linear order and fixes many broken edge cases.
This commit is contained in:
1 parent
8d5fcade02
commit
82dce233bc
1 file changed
+4
-4
+4
-4
@@ -496,11 +496,11 @@ static bool compare_track(struct track *t1, struct track *t2, char **langs, bool
|
||||
int l1 = mp_match_lang(langs, t1->lang), l2 = mp_match_lang(langs, t2->lang);
|
||||
if (!os_langs && l1 != l2)
|
||||
return l1 > l2;
|
||||
if (t1->forced_select)
|
||||
return t1->forced_track;
|
||||
if (t1->default_track != t2->default_track && !t2->forced_select)
|
||||
if (t1->forced_select != t2->forced_select)
|
||||
return t1->forced_select;
|
||||
if (t1->default_track != t2->default_track)
|
||||
return t1->default_track;
|
||||
if (sub && !t2->forced_select && t2->forced_track)
|
||||
if (sub && t1->forced_track != t2->forced_track)
|
||||
return !t1->forced_track;
|
||||
if (os_langs && l1 != l2)
|
||||
return l1 > l2;
|
||||
|
||||
Reference in new issue
Block a user