matroska-demux: assume matroska if no doctype is specified

https://bugzilla.gnome.org/show_bug.cgi?id=638019
This commit is contained in:
Tim-Philipp Müller 2010-12-29 23:09:04 +00:00
parent 6c8268dbfd
commit c8fc90fd37

View file

@ -3099,26 +3099,30 @@ gst_matroska_demux_parse_header (GstMatroskaDemux * demux, GstEbmlRead * ebml)
} }
exit: exit:
ret = GST_FLOW_ERROR;
if (doctype) { if ((doctype != NULL && !strcmp (doctype, GST_MATROSKA_DOCTYPE_MATROSKA)) ||
if (g_str_equal (doctype, GST_MATROSKA_DOCTYPE_MATROSKA) || (doctype != NULL && !strcmp (doctype, GST_MATROSKA_DOCTYPE_WEBM)) ||
g_str_equal (doctype, GST_MATROSKA_DOCTYPE_WEBM)) { (doctype == NULL)) {
if (version <= 2) { if (version <= 2) {
if (doctype) {
GST_INFO_OBJECT (demux, "Input is %s version %d", doctype, version); GST_INFO_OBJECT (demux, "Input is %s version %d", doctype, version);
ret = GST_FLOW_OK;
} else { } else {
GST_ELEMENT_ERROR (demux, STREAM, DEMUX, (NULL), GST_WARNING_OBJECT (demux, "Input is EBML without doctype, assuming "
("Demuxer version (2) is too old to read %s version %d", "matroska (version %d)", version);
doctype, version));
} }
ret = GST_FLOW_OK;
} else { } else {
GST_ELEMENT_ERROR (demux, STREAM, WRONG_TYPE, (NULL), GST_ELEMENT_ERROR (demux, STREAM, DEMUX, (NULL),
("Input is not a matroska stream (doctype=%s)", doctype)); ("Demuxer version (2) is too old to read %s version %d",
GST_STR_NULL (doctype), version));
ret = GST_FLOW_ERROR;
} }
g_free (doctype); g_free (doctype);
} else { } else {
GST_ELEMENT_ERROR (demux, STREAM, WRONG_TYPE, (NULL), GST_ELEMENT_ERROR (demux, STREAM, WRONG_TYPE, (NULL),
("Input is not a matroska stream")); ("Input is not a matroska stream (doctype=%s)", doctype));
ret = GST_FLOW_ERROR;
g_free (doctype);
} }
return ret; return ret;