mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-18 22:36:33 +00:00
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
1 changed files with 4 additions and 0 deletions
|
@ -1280,6 +1280,7 @@ static void
|
|||
svg_type_find (GstTypeFind * tf, gpointer unused)
|
||||
{
|
||||
static const gchar svg_doctype[] = "!DOCTYPE svg";
|
||||
static const gchar svg_tag[] = "<svg";
|
||||
DataScanCtx c = { 0, NULL, 0 };
|
||||
|
||||
while (c.offset <= 1024) {
|
||||
|
@ -1289,6 +1290,9 @@ svg_type_find (GstTypeFind * tf, gpointer unused)
|
|||
if (memcmp (svg_doctype, c.data, 12) == 0) {
|
||||
gst_type_find_suggest (tf, GST_TYPE_FIND_MAXIMUM, SVG_CAPS);
|
||||
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);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue