avformat/matroskaenc: Don't write empty language

According to the new EBML specifications, a string element of length
zero would be read as the default value by a compliant parser.

Reviewed-by: Ridley Combs <rcombs@rcombs.me>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
pull/371/head
Andreas Rheinhardt 4 years ago
parent e8f3901604
commit 3ac5530244
  1. 2
      libavformat/matroskaenc.c

@ -1147,7 +1147,7 @@ static int mkv_write_track(AVFormatContext *s, MatroskaMuxContext *mkv,
put_ebml_string(pb, MATROSKA_ID_TRACKNAME, tag->value);
tag = av_dict_get(st->metadata, "language", NULL, 0);
put_ebml_string(pb, MATROSKA_ID_TRACKLANGUAGE,
tag && tag->value ? tag->value : "und");
tag && tag->value[0] ? tag->value : "und");
// The default value for TRACKFLAGDEFAULT is 1, so add element
// if we need to clear it.

Loading…
Cancel
Save