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.
This commit is contained in:
wm4 2018-04-21 13:25:32 +02:00 committed by Jan Ekström
parent 4b32d51b96
commit c767451796
1 changed files with 1 additions and 1 deletions

View File

@ -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)