mirror of
https://github.com/mpv-player/mpv
synced 2025-03-21 18:57:35 +00:00
loadfile: short-circuit early on null stream language
This commit is contained in:
parent
57dae8f42c
commit
be34f52f72
@ -444,6 +444,8 @@ void add_demuxer_tracks(struct MPContext *mpctx, struct demuxer *demuxer)
|
|||||||
// Result numerically higher => better match. 0 == no match.
|
// Result numerically higher => better match. 0 == no match.
|
||||||
static int match_lang(char **langs, char *lang)
|
static int match_lang(char **langs, char *lang)
|
||||||
{
|
{
|
||||||
|
if (!lang)
|
||||||
|
return 0;
|
||||||
for (int idx = 0; langs && langs[idx]; idx++) {
|
for (int idx = 0; langs && langs[idx]; idx++) {
|
||||||
if (lang && strcasecmp(langs[idx], lang) == 0)
|
if (lang && strcasecmp(langs[idx], lang) == 0)
|
||||||
return INT_MAX - idx;
|
return INT_MAX - idx;
|
||||||
|
Loading…
Reference in New Issue
Block a user