diff options
author | Günter Thelen <daedalus.inc@gmx.net> | 2007-01-08 14:01:23 +0000 |
---|---|---|
committer | Tim-Philipp Müller <tim@centricular.net> | 2007-01-08 14:01:23 +0000 |
commit | 7ccf512bced1e73f9417a61698f1584faf047bad (patch) | |
tree | 82fc54f9f77d88b4834bce8439a40a1f11fba451 /gst | |
parent | 5fecea65a6f1b7c08939a36c4c5851b1383adef6 (diff) | |
download | gstreamer-plugins-base-7ccf512bced1e73f9417a61698f1584faf047bad.tar.gz |
gst/typefind/gsttypefindfunctions.c: Add typefinder for flac-in-ogg in conformance with the ogg-mapping on flac.sf.ne...
Original commit message from CVS:
Patch by: Günter Thelen <daedalus dot inc at gmx net>
* gst/typefind/gsttypefindfunctions.c: (flac_type_find),
(plugin_init):
Add typefinder for flac-in-ogg in conformance with the ogg-mapping
on flac.sf.net (there appear to be other versions of the first
ogg page in the wild) (#391365).
Diffstat (limited to 'gst')
-rw-r--r-- | gst/typefind/gsttypefindfunctions.c | 27 |
1 files changed, 25 insertions, 2 deletions
diff --git a/gst/typefind/gsttypefindfunctions.c b/gst/typefind/gsttypefindfunctions.c index 05e957f00..639e1a6c5 100644 --- a/gst/typefind/gsttypefindfunctions.c +++ b/gst/typefind/gsttypefindfunctions.c @@ -401,6 +401,29 @@ tta_type_find (GstTypeFind * tf, gpointer unused) } } +/*** audio/x-flac ***/ +static GstStaticCaps flac_caps = GST_STATIC_CAPS ("audio/x-flac"); + +#define FLAC_CAPS (gst_static_caps_get(&flac_caps)) + +static void +flac_type_find (GstTypeFind * tf, gpointer unused) +{ + guint8 *data; + + data = gst_type_find_peek (tf, 0, 5); + if (G_LIKELY (data)) { + /* standard flac */ + if (memcmp (data, "fLaC", 4) == 0) { + gst_type_find_suggest (tf, GST_TYPE_FIND_MAXIMUM, FLAC_CAPS); + } + /* flac-in-ogg, see http://flac.sourceforge.net/ogg_mapping.html */ + else if (memcmp (data, "\177FLAC\001", 6) == 0) { + gst_type_find_suggest (tf, GST_TYPE_FIND_MAXIMUM, FLAC_CAPS); + } + } +} + /*** audio/mpeg version 2, 4 ***/ static GstStaticCaps aac_caps = GST_STATIC_CAPS ("audio/mpeg, " @@ -2665,8 +2688,6 @@ plugin_init (GstPlugin * plugin) TYPE_FIND_REGISTER_START_WITH (plugin, "video/x-vcd", GST_RANK_PRIMARY, cdxa_exts, "\000\377\377\377\377\377\377\377\377\377\377\000", 12, GST_TYPE_FIND_MAXIMUM); - TYPE_FIND_REGISTER_START_WITH (plugin, "audio/x-flac", GST_RANK_PRIMARY, - flac_exts, "fLaC", 4, GST_TYPE_FIND_MAXIMUM); TYPE_FIND_REGISTER (plugin, "video/x-fli", GST_RANK_MARGINAL, flx_type_find, flx_exts, FLX_CAPS, NULL, NULL); TYPE_FIND_REGISTER (plugin, "application/x-id3v2", GST_RANK_PRIMARY + 3, @@ -2795,6 +2816,8 @@ plugin_init (GstPlugin * plugin) zip_exts, "PK\003\004", 4, GST_TYPE_FIND_LIKELY); TYPE_FIND_REGISTER_START_WITH (plugin, "application/x-compress", GST_RANK_SECONDARY, compress_exts, "\037\235", 2, GST_TYPE_FIND_LIKELY); + TYPE_FIND_REGISTER (plugin, "audio/x-flac", GST_RANK_PRIMARY, + flac_type_find, flac_exts, FLAC_CAPS, NULL, NULL); TYPE_FIND_REGISTER (plugin, "audio/x-vorbis", GST_RANK_PRIMARY, vorbis_type_find, NULL, VORBIS_CAPS, NULL, NULL); TYPE_FIND_REGISTER (plugin, "video/x-theora", GST_RANK_PRIMARY, |