summaryrefslogtreecommitdiff
path: root/libavformat/matroskaenc.c
diff options
context:
space:
mode:
authorMichael Bradshaw <mjbshaw@google.com>2016-06-20 14:25:48 -0700
committerMichael Niedermayer <michael@niedermayer.cc>2016-06-22 12:12:46 +0200
commit989a614b707dcff8abdffe28dc24ec64a83b2837 (patch)
tree2ef9eea9876902c108c0e9f45e9f359eec39c179 /libavformat/matroskaenc.c
parent5558ff3a9f11acbf751fe46a27f5c67b04b23884 (diff)
libavformat/matroskaenc: omit segment UID for webm
SegmentUID is not a supported element in WebM. See: http://www.webmproject.org/docs/container/#SegmentUID Reviewed-by: Dave Rice <dave@dericed.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavformat/matroskaenc.c')
-rw-r--r--libavformat/matroskaenc.c21
1 files changed, 12 insertions, 9 deletions
diff --git a/libavformat/matroskaenc.c b/libavformat/matroskaenc.c
index 6252de88be..ddac2d3df5 100644
--- a/libavformat/matroskaenc.c
+++ b/libavformat/matroskaenc.c
@@ -1559,20 +1559,23 @@ static int mkv_write_header(AVFormatContext *s)
if ((tag = av_dict_get(s->metadata, "title", NULL, 0)))
put_ebml_string(pb, MATROSKA_ID_TITLE, tag->value);
if (!(s->flags & AVFMT_FLAG_BITEXACT)) {
- uint32_t segment_uid[4];
- AVLFG lfg;
-
- av_lfg_init(&lfg, av_get_random_seed());
-
- for (i = 0; i < 4; i++)
- segment_uid[i] = av_lfg_get(&lfg);
-
put_ebml_string(pb, MATROSKA_ID_MUXINGAPP, LIBAVFORMAT_IDENT);
if ((tag = av_dict_get(s->metadata, "encoding_tool", NULL, 0)))
put_ebml_string(pb, MATROSKA_ID_WRITINGAPP, tag->value);
else
put_ebml_string(pb, MATROSKA_ID_WRITINGAPP, LIBAVFORMAT_IDENT);
- put_ebml_binary(pb, MATROSKA_ID_SEGMENTUID, segment_uid, 16);
+
+ if (mkv->mode != MODE_WEBM) {
+ uint32_t segment_uid[4];
+ AVLFG lfg;
+
+ av_lfg_init(&lfg, av_get_random_seed());
+
+ for (i = 0; i < 4; i++)
+ segment_uid[i] = av_lfg_get(&lfg);
+
+ put_ebml_binary(pb, MATROSKA_ID_SEGMENTUID, segment_uid, 16);
+ }
} else {
const char *ident = "Lavf";
put_ebml_string(pb, MATROSKA_ID_MUXINGAPP , ident);