From 5be137bbea734787434de05cf388eb5fb6218e14 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim-Philipp=20M=C3=BCller?= Date: Wed, 1 Mar 2006 19:24:44 +0000 Subject: [PATCH] gst/typefind/gsttypefindfunctions.c: Some typefinding fine-tuning: 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 | 10 ++++++++++ gst/typefind/gsttypefindfunctions.c | 10 +++++----- 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog index 2c256acf48..a6c9fb8d0e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,13 @@ +2006-03-01 Tim-Philipp Müller + + * 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 * docs/plugins/Makefile.am: diff --git a/gst/typefind/gsttypefindfunctions.c b/gst/typefind/gsttypefindfunctions.c index c98437c513..cb2f40ef45 100644 --- a/gst/typefind/gsttypefindfunctions.c +++ b/gst/typefind/gsttypefindfunctions.c @@ -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,