summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorReynaldo H. Verdejo Pinochet <r.verdejo@partner.samsung.com>2013-10-04 14:42:59 -0700
committerReynaldo H. Verdejo Pinochet <r.verdejo@partner.samsung.com>2013-10-06 08:12:50 -0700
commitedeed575ae6998a5c6d2756d56c987f0aa8ac04f (patch)
tree672f4af4b02f0cbe3ad9983bc0ce202ea8d9c251
parentcf12017ef8d6c209be64a9bb5475ca0d2c926345 (diff)
matroska: Do not write SegmentUID for WebM mux
WebM spec states SegmentUID is Unsupported. Files produced with gstreamer without this change will spit an error like this when passed to mkvalidator: ERR201: Invalid 'SegmentUID' for profile 'webm' in Info at 192
-rw-r--r--gst/matroska/matroska-mux.c20
1 files changed, 15 insertions, 5 deletions
diff --git a/gst/matroska/matroska-mux.c b/gst/matroska/matroska-mux.c
index d535fd3b6..7b846e518 100644
--- a/gst/matroska/matroska-mux.c
+++ b/gst/matroska/matroska-mux.c
@@ -2481,6 +2481,7 @@ gst_matroska_mux_start (GstMatroskaMux * mux)
};
const gchar *media_type;
gboolean audio_only;
+ gboolean is_webm = FALSE;
guint64 master, child;
GSList *collected;
int i;
@@ -2521,9 +2522,13 @@ gst_matroska_mux_start (GstMatroskaMux * mux)
g_snprintf (s_id, sizeof (s_id), "matroskamux-%08x", g_random_int ());
gst_pad_push_event (mux->srcpad, gst_event_new_stream_start (s_id));
+ /* Are we muxing a WebM stream? */
+ if (!strcmp (mux->doctype, GST_MATROSKA_DOCTYPE_WEBM)) {
+ is_webm = TRUE;
+ }
/* output caps */
audio_only = mux->num_v_streams == 0 && mux->num_a_streams > 0;
- if (!strcmp (mux->doctype, GST_MATROSKA_DOCTYPE_WEBM)) {
+ if (is_webm) {
media_type = (audio_only) ? "audio/webm" : "video/webm";
} else {
media_type = (audio_only) ? "audio/x-matroska" : "video/x-matroska";
@@ -2581,11 +2586,16 @@ gst_matroska_mux_start (GstMatroskaMux * mux)
/* segment info */
mux->info_pos = ebml->pos;
master = gst_ebml_write_master_start (ebml, GST_MATROSKA_ID_SEGMENTINFO);
- for (i = 0; i < 4; i++) {
- segment_uid[i] = g_random_int ();
+
+ /* WebM does not support SegmentUID field on SegmentInfo */
+ if (!is_webm) {
+ for (i = 0; i < 4; i++) {
+ segment_uid[i] = g_random_int ();
+ }
+ gst_ebml_write_binary (ebml, GST_MATROSKA_ID_SEGMENTUID,
+ (guint8 *) segment_uid, 16);
}
- gst_ebml_write_binary (ebml, GST_MATROSKA_ID_SEGMENTUID,
- (guint8 *) segment_uid, 16);
+
gst_ebml_write_uint (ebml, GST_MATROSKA_ID_TIMECODESCALE, mux->time_scale);
mux->duration_pos = ebml->pos;
/* get duration */