summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2018-04-21 13:25:32 +0200
committerJan Ekström <jeebjp@gmail.com>2018-04-29 02:21:32 +0300
commitc767451796704ba1d3cd497cd0f1b983edf041dd (patch)
tree8b9023eb9342c555e633e2997540c165b5ef0c24
parent4b32d51b962bc1950a7efeacdcfce5c45716bb67 (diff)
downloadmpv-c767451796704ba1d3cd497cd0f1b983edf041dd.tar.bz2
mpv-c767451796704ba1d3cd497cd0f1b983edf041dd.tar.xz
demux_lavf: discard "und" language tag
Going by ISO 639.2, "und" means "Undetermined". Whatever it's supposed to mean, in practice it's user for "unset". We prefer if the language tag remains simply unset in this case. This removes an ugliness with mp4 in partricular, because libavformat will export unset languages as such, which affects most mp4 files.
-rw-r--r--demux/demux_lavf.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/demux/demux_lavf.c b/demux/demux_lavf.c
index dd98fc0c8d..fb4678801a 100644
--- a/demux/demux_lavf.c
+++ b/demux/demux_lavf.c
@@ -727,7 +727,7 @@ static void handle_new_stream(demuxer_t *demuxer, int i)
if (st->disposition & AV_DISPOSITION_DEPENDENT)
sh->dependent_track = true;
AVDictionaryEntry *lang = av_dict_get(st->metadata, "language", NULL, 0);
- if (lang && lang->value)
+ if (lang && lang->value && strcmp(lang->value, "und") != 0)
sh->lang = talloc_strdup(sh, lang->value);
sh->hls_bitrate = dict_get_decimal(st->metadata, "variant_bitrate", 0);
if (!sh->title && sh->hls_bitrate > 0)