typefindfunctions: Also detect SVG by the <svg> starting tag
Not all SVG images have the DOCTYPE specified.
This commit is contained in:
parent
cb19626c8c
commit
3b4c35e319
@ -1280,6 +1280,7 @@ static void
|
|||||||
svg_type_find (GstTypeFind * tf, gpointer unused)
|
svg_type_find (GstTypeFind * tf, gpointer unused)
|
||||||
{
|
{
|
||||||
static const gchar svg_doctype[] = "!DOCTYPE svg";
|
static const gchar svg_doctype[] = "!DOCTYPE svg";
|
||||||
|
static const gchar svg_tag[] = "<svg";
|
||||||
DataScanCtx c = { 0, NULL, 0 };
|
DataScanCtx c = { 0, NULL, 0 };
|
||||||
|
|
||||||
while (c.offset <= 1024) {
|
while (c.offset <= 1024) {
|
||||||
@ -1289,6 +1290,9 @@ svg_type_find (GstTypeFind * tf, gpointer unused)
|
|||||||
if (memcmp (svg_doctype, c.data, 12) == 0) {
|
if (memcmp (svg_doctype, c.data, 12) == 0) {
|
||||||
gst_type_find_suggest (tf, GST_TYPE_FIND_MAXIMUM, SVG_CAPS);
|
gst_type_find_suggest (tf, GST_TYPE_FIND_MAXIMUM, SVG_CAPS);
|
||||||
return;
|
return;
|
||||||
|
} else if (memcmp (svg_tag, c.data, 4) == 0) {
|
||||||
|
gst_type_find_suggest (tf, GST_TYPE_FIND_LIKELY, SVG_CAPS);
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
data_scan_ctx_advance (tf, &c, 1);
|
data_scan_ctx_advance (tf, &c, 1);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user