summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorReynaldo H. Verdejo Pinochet <reynaldo@osg.samsung.com>2016-12-02 15:12:12 -0800
committerReynaldo H. Verdejo Pinochet <reynaldo@osg.samsung.com>2016-12-02 16:13:24 -0800
commit13a491fb6c27f9b2ee7be03bc6b788e2a899d403 (patch)
tree9dced94ea9af37bbc8b3bd9ffdc15bd28f1b258d
parentd452ad0ecaba7add0ea68861f7a73ba7bc82d3cb (diff)
typefind: add another test to itc typefinder
Report certainty after every test passes. Additionally: - Remove self-explanatory comment.
-rw-r--r--gst/typefind/gsttypefindfunctions.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/gst/typefind/gsttypefindfunctions.c b/gst/typefind/gsttypefindfunctions.c
index d79044574..7df74fc59 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);