gst/typefind/gsttypefindfunctions.c: Some typefinding fine-tuning:
authorTim-Philipp Müller <tim@centricular.net>
Wed, 1 Mar 2006 19:24:44 +0000 (19:24 +0000)
committerTim-Philipp Müller <tim@centricular.net>
Wed, 1 Mar 2006 19:24:44 +0000 (19:24 +0000)
Original commit message from CVS:
* gst/typefind/gsttypefindfunctions.c: (id3_type_find),
(apetag_type_find), (ape_type_find), (plugin_init):
Some typefinding fine-tuning:
- rank ID3/APE tags in order of preference via probabilities, so that
ID3v2 > APEv2 > APEv1 > ID3v1.
- three or four bytes don't really justify MAXIMUM probability,
change those to 'very likely' (musepack and monkeysaudio).

ChangeLog
gst/typefind/gsttypefindfunctions.c

index 2c256ac..a6c9fb8 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2006-03-01  Tim-Philipp Müller  <tim at centricular dot net>
+
+       * gst/typefind/gsttypefindfunctions.c: (id3_type_find),
+       (apetag_type_find), (ape_type_find), (plugin_init):
+         Some typefinding fine-tuning:
+         - rank ID3/APE tags in order of preference via probabilities, so that
+           ID3v2 > APEv2 > APEv1 > ID3v1.
+         - three or four bytes don't really justify MAXIMUM probability,
+           change those to 'very likely' (musepack and monkeysaudio).
+
 2006-03-01  Wim Taymans  <wim@fluendo.com>
 
        * docs/plugins/Makefile.am:
index c98437c..cb2f40e 100644 (file)
@@ -272,7 +272,7 @@ id3_type_find (GstTypeFind * tf, gpointer unused)
   }
   data = gst_type_find_peek (tf, -128, 3);
   if (data && memcmp (data, "TAG", 3) == 0) {
-    gst_type_find_suggest (tf, GST_TYPE_FIND_MAXIMUM, ID3_CAPS);
+    gst_type_find_suggest (tf, GST_TYPE_FIND_MAXIMUM - 3, ID3_CAPS);
   }
 }
 
@@ -289,14 +289,14 @@ apetag_type_find (GstTypeFind * tf, gpointer unused)
   /* APEv1/2 at start of file */
   data = gst_type_find_peek (tf, 0, 8);
   if (data && !memcmp (data, "APETAGEX", 8)) {
-    gst_type_find_suggest (tf, GST_TYPE_FIND_MAXIMUM, APETAG_CAPS);
+    gst_type_find_suggest (tf, GST_TYPE_FIND_MAXIMUM - 1, APETAG_CAPS);
     return;
   }
 
   /* APEv1/2 at end of file */
   data = gst_type_find_peek (tf, -32, 8);
   if (data && !memcmp (data, "APETAGEX", 8)) {
-    gst_type_find_suggest (tf, GST_TYPE_FIND_MAXIMUM, APETAG_CAPS);
+    gst_type_find_suggest (tf, GST_TYPE_FIND_MAXIMUM - 2, APETAG_CAPS);
     return;
   }
 }
@@ -1180,7 +1180,7 @@ ape_type_find (GstTypeFind * tf, gpointer unused)
   guint8 *data = gst_type_find_peek (tf, 0, 4);
 
   if (data && memcmp (data, "MAC ", 4) == 0) {
-    gst_type_find_suggest (tf, GST_TYPE_FIND_MAXIMUM, APE_CAPS);
+    gst_type_find_suggest (tf, GST_TYPE_FIND_LIKELY + 10, APE_CAPS);
   }
 }
 
@@ -2167,7 +2167,7 @@ plugin_init (GstPlugin * plugin)
       GST_TYPE_FIND_MAXIMUM);
   /* -1 so id3v1 or apev1/2 are detected with higher preference */
   TYPE_FIND_REGISTER_START_WITH (plugin, "audio/x-musepack", GST_RANK_PRIMARY,
-      musepack_exts, "MP+", 3, GST_TYPE_FIND_MAXIMUM - 1);
+      musepack_exts, "MP+", 3, GST_TYPE_FIND_LIKELY + 10);
   TYPE_FIND_REGISTER (plugin, "audio/x-au", GST_RANK_MARGINAL,
       au_type_find, au_exts, AU_CAPS, NULL, NULL);
   TYPE_FIND_REGISTER_RIFF (plugin, "video/x-msvideo", GST_RANK_PRIMARY,