From: Tim-Philipp Müller Date: Wed, 29 Dec 2010 22:36:41 +0000 (+0000) Subject: typefinding: assume EBML files without doctype are matroska X-Git-Tag: RELEASE-0.10.32~72 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=bb786dfb5cc480b0329876b123e468a26031cf71;p=platform%2Fupstream%2Fgst-plugins-base.git typefinding: assume EBML files without doctype are matroska https://bugzilla.gnome.org/show_bug.cgi?id=638019 --- diff --git a/gst/typefind/gsttypefindfunctions.c b/gst/typefind/gsttypefindfunctions.c index 5944c70..640f769 100644 --- a/gst/typefind/gsttypefindfunctions.c +++ b/gst/typefind/gsttypefindfunctions.c @@ -3184,6 +3184,10 @@ ebml_check_header (GstTypeFind * tf, const gchar * doctype, int doctype_len) if (!data) return FALSE; + /* only check doctype if asked to do so */ + if (doctype == NULL || doctype_len == 0) + return TRUE; + /* the header must contain the doctype. For now, we don't parse the * whole header but simply check for the availability of that array * of characters inside the header. Not fully fool-proof, but good @@ -3204,6 +3208,8 @@ matroska_type_find (GstTypeFind * tf, gpointer ununsed) { if (ebml_check_header (tf, "matroska", 8)) gst_type_find_suggest (tf, GST_TYPE_FIND_MAXIMUM, MATROSKA_CAPS); + else if (ebml_check_header (tf, NULL, 0)) + gst_type_find_suggest (tf, GST_TYPE_FIND_LIKELY, MATROSKA_CAPS); } /*** video/webm ***/