From 13a491fb6c27f9b2ee7be03bc6b788e2a899d403 Mon Sep 17 00:00:00 2001 From: "Reynaldo H. Verdejo Pinochet" Date: Fri, 2 Dec 2016 15:12:12 -0800 Subject: [PATCH] typefind: add another test to itc typefinder Report certainty after every test passes. Additionally: - Remove self-explanatory comment. --- gst/typefind/gsttypefindfunctions.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/gst/typefind/gsttypefindfunctions.c b/gst/typefind/gsttypefindfunctions.c index d79044574a..7df74fc596 100644 --- a/gst/typefind/gsttypefindfunctions.c +++ b/gst/typefind/gsttypefindfunctions.c @@ -433,6 +433,7 @@ itc_type_find (GstTypeFind * tf, gpointer unused) guint8 magic[8] = { 0x00, 0x00, 0x01, 0x1C, 0x69, 0x74, 0x63, 0x68 }; guint8 preamble[4] = { 0x00, 0x00, 0x00, 0x02 }; guint8 artwork_marker[8] = { 0x00, 0x00, 0x00, 0x00, 0x61, 0x72, 0x74, 0x77 }; + guint8 item_marker[4] = { 0x69, 0x74, 0x65, 0x6D }; GstTypeFindProbability itc_prob = GST_TYPE_FIND_NONE; int i; @@ -461,7 +462,6 @@ itc_type_find (GstTypeFind * tf, gpointer unused) if (G_UNLIKELY (!data_scan_ctx_ensure_data (tf, &c, 8))) goto done; - /* Look for "artw" marker */ if (memcmp (c.data, artwork_marker, 8)) goto done; @@ -478,6 +478,15 @@ itc_type_find (GstTypeFind * tf, gpointer unused) } itc_prob = GST_TYPE_FIND_NEARLY_CERTAIN; + data_scan_ctx_advance (tf, &c, 256); + + if (G_UNLIKELY (!data_scan_ctx_ensure_data (tf, &c, 8))) + goto done; + + if (memcmp (c.data + 4, item_marker, 4)) + goto done; + + itc_prob = GST_TYPE_FIND_MAXIMUM; done: gst_type_find_suggest (tf, itc_prob, ITC_CAPS);