static void
unicode_type_find (GstTypeFind * tf, const GstUnicodeTester * tester,
- guint n_tester, const char *media_type)
+ guint n_tester, const char *media_type, gboolean require_bom)
{
size_t n;
gint len = 4;
if (!memcmp (data, tester[n].bom, tester[n].bomlen))
bom_boost = tester[n].boost;
}
+ if (require_bom && bom_boost == 0)
+ continue;
if (!(*tester[n].checker) (data, len, tester[n].endianness))
continue;
tmpprob = GST_TYPE_FIND_POSSIBLE - 20 + bom_boost;
{2, "\xfe\xff", check_utf16, 20, G_BIG_ENDIAN},
};
unicode_type_find (tf, utf16tester, G_N_ELEMENTS (utf16tester),
- "text/utf-16");
+ "text/utf-16", TRUE);
}
static GstStaticCaps utf32_caps = GST_STATIC_CAPS ("text/utf-32");
{4, "\x00\x00\xfe\xff", check_utf32, 20, G_BIG_ENDIAN}
};
unicode_type_find (tf, utf32tester, G_N_ELEMENTS (utf32tester),
- "text/utf-32");
+ "text/utf-32", TRUE);
}
/*** text/uri-list ***/