matroskamux: Always use v4 for DocType version

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5534>
This commit is contained in:
Doug Nazar 2019-08-07 17:47:29 -04:00
parent 8e6ec1fc34
commit 671dd6a61e
5 changed files with 10 additions and 9 deletions

View File

@ -911,7 +911,7 @@ gst_ebml_replace_uint (GstEbmlWrite * ebml, guint64 pos, guint64 num)
*/
void
gst_ebml_write_header (GstEbmlWrite * ebml, const gchar * doctype,
guint version)
guint version, guint readversion)
{
guint64 pos;
@ -929,7 +929,7 @@ gst_ebml_write_header (GstEbmlWrite * ebml, const gchar * doctype,
#endif
gst_ebml_write_ascii (ebml, GST_EBML_ID_DOCTYPE, doctype);
gst_ebml_write_uint (ebml, GST_EBML_ID_DOCTYPEVERSION, version);
gst_ebml_write_uint (ebml, GST_EBML_ID_DOCTYPEREADVERSION, version);
gst_ebml_write_uint (ebml, GST_EBML_ID_DOCTYPEREADVERSION, readversion);
gst_ebml_write_master_finish (ebml, pos);
gst_ebml_write_flush_cache (ebml, FALSE, 0);
}

View File

@ -130,7 +130,8 @@ void gst_ebml_write_binary (GstEbmlWrite *ebml,
guint64 length);
void gst_ebml_write_header (GstEbmlWrite *ebml,
const gchar *doctype,
guint version);
guint version,
guint readversion);
/*
* Note: this is supposed to be used only for media data.

View File

@ -3192,9 +3192,9 @@ gst_matroska_mux_start_file (GstMatroskaMux * mux)
/* we start with a EBML header */
doctype = mux->doctype;
GST_INFO_OBJECT (ebml, "DocType: %s, Version: %d",
doctype, mux->doctype_version);
gst_ebml_write_header (ebml, doctype, mux->doctype_version);
GST_INFO_OBJECT (ebml, "DocType: %s, Version: 4/%d", doctype,
mux->doctype_version);
gst_ebml_write_header (ebml, doctype, 4, mux->doctype_version);
/* the rest of the header is cached */
gst_ebml_write_set_cache (ebml, 0x1000);

View File

@ -103,7 +103,7 @@ struct _GstMatroskaMux {
/* EBML DocType. */
const gchar *doctype;
/* DocType version. */
/* DocType read version. Minimal version of specification required to read file */
guint doctype_version;
/* state */

View File

@ -97,7 +97,7 @@ GST_START_TEST (test_ebml_header_v1)
0x6d, 0x61, 0x74, 0x72, 0x6f, 0x73, 0x6b, 0x61, 0x00, /* "matroska" */
0x42, 0x87, /* doctypeversion */
0x81, /* 1 byte */
0x01, /* 1 */
0x04, /* 4 */
0x42, 0x85, /* doctypereadversion */
0x81, /* 1 byte */
0x01, /* 1 */
@ -118,7 +118,7 @@ GST_START_TEST (test_ebml_header_v2)
0x6d, 0x61, 0x74, 0x72, 0x6f, 0x73, 0x6b, 0x61, 0x00, /* "matroska" */
0x42, 0x87, /* doctypeversion */
0x81, /* 1 byte */
0x02, /* 2 */
0x04, /* 4 */
0x42, 0x85, /* doctypereadversion */
0x81, /* 1 byte */
0x02, /* 2 */