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).
This commit is contained in:
Tim-Philipp Müller 2006-03-01 19:24:44 +00:00
parent b6e0165934
commit 5be137bbea
2 changed files with 15 additions and 5 deletions

View file

@ -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> 2006-03-01 Wim Taymans <wim@fluendo.com>
* docs/plugins/Makefile.am: * docs/plugins/Makefile.am:

View file

@ -272,7 +272,7 @@ id3_type_find (GstTypeFind * tf, gpointer unused)
} }
data = gst_type_find_peek (tf, -128, 3); data = gst_type_find_peek (tf, -128, 3);
if (data && memcmp (data, "TAG", 3) == 0) { 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 */ /* APEv1/2 at start of file */
data = gst_type_find_peek (tf, 0, 8); data = gst_type_find_peek (tf, 0, 8);
if (data && !memcmp (data, "APETAGEX", 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; return;
} }
/* APEv1/2 at end of file */ /* APEv1/2 at end of file */
data = gst_type_find_peek (tf, -32, 8); data = gst_type_find_peek (tf, -32, 8);
if (data && !memcmp (data, "APETAGEX", 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; return;
} }
} }
@ -1180,7 +1180,7 @@ ape_type_find (GstTypeFind * tf, gpointer unused)
guint8 *data = gst_type_find_peek (tf, 0, 4); guint8 *data = gst_type_find_peek (tf, 0, 4);
if (data && memcmp (data, "MAC ", 4) == 0) { 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); GST_TYPE_FIND_MAXIMUM);
/* -1 so id3v1 or apev1/2 are detected with higher preference */ /* -1 so id3v1 or apev1/2 are detected with higher preference */
TYPE_FIND_REGISTER_START_WITH (plugin, "audio/x-musepack", GST_RANK_PRIMARY, 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, TYPE_FIND_REGISTER (plugin, "audio/x-au", GST_RANK_MARGINAL,
au_type_find, au_exts, AU_CAPS, NULL, NULL); au_type_find, au_exts, AU_CAPS, NULL, NULL);
TYPE_FIND_REGISTER_RIFF (plugin, "video/x-msvideo", GST_RANK_PRIMARY, TYPE_FIND_REGISTER_RIFF (plugin, "video/x-msvideo", GST_RANK_PRIMARY,