1
0
mirror of https://github.com/mpv-player/mpv synced 2025-03-20 18:28:01 +00:00

loadfile: short-circuit early on null stream language

This commit is contained in:
rcombs 2021-05-26 17:56:59 -05:00 committed by sfan5
parent 57dae8f42c
commit be34f52f72

View File

@ -444,6 +444,8 @@ void add_demuxer_tracks(struct MPContext *mpctx, struct demuxer *demuxer)
// Result numerically higher => better match. 0 == no match.
static int match_lang(char **langs, char *lang)
{
if (!lang)
return 0;
for (int idx = 0; langs && langs[idx]; idx++) {
if (lang && strcasecmp(langs[idx], lang) == 0)
return INT_MAX - idx;