From 7248590db37550301e8dda6db6353d240a4a6d3c Mon Sep 17 00:00:00 2001 From: "Arwed v. Merkatz" Date: Wed, 25 Aug 2004 14:12:54 +0000 Subject: [PATCH] Typefinding for TTA files, fixes bug #148711. Original commit message from CVS: Typefinding for TTA files, fixes bug #148711. --- ChangeLog | 2 ++ gst/typefind/gsttypefindfunctions.c | 23 ++++++++++++++++++++++- 2 files changed, 24 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 8e8700f4b8..8a0dee8ed5 100644 --- a/ChangeLog +++ b/ChangeLog @@ -2,6 +2,8 @@ * gst/matroska/matroska-demux.c: (gst_matroska_demux_parse_blockgroup), send vorbis headers at the beginning of a stream, fixes bug #141554. + * gst/typefind/gsttypefindfunctions.c: (tta_type_find), (plugin_init), + enable typefinding for TTA audio files, fixes bug #148711. 2004-08-24 Sebastien Cote diff --git a/gst/typefind/gsttypefindfunctions.c b/gst/typefind/gsttypefindfunctions.c index a8025354ab..6bed020402 100644 --- a/gst/typefind/gsttypefindfunctions.c +++ b/gst/typefind/gsttypefindfunctions.c @@ -190,6 +190,24 @@ id3_type_find (GstTypeFind * tf, gpointer unused) } } +/*** audio/x-tta *************************************************************/ + +static GstStaticCaps tta_caps = GST_STATIC_CAPS ("audio/x-tta"); + +#define TTA_CAPS gst_static_caps_get(&tta_caps) +static void +tta_type_find (GstTypeFind * tf, gpointer unused) +{ + guint8 *data = gst_type_find_peek (tf, 0, 3); + + if (data) { + if (memcmp (data, "TTA", 3) == 0) { + gst_type_find_suggest (tf, GST_TYPE_FIND_MAXIMUM, TTA_CAPS); + return; + } + } +} + /*** audio/mpeg version 2, 4 *************************************************/ static GstStaticCaps aac_caps = GST_STATIC_CAPS ("audio/mpeg, " @@ -1308,7 +1326,8 @@ plugin_init (GstPlugin * plugin) static gchar *flac_exts[] = { "flac", NULL }; static gchar *flx_exts[] = { "flc", "fli", NULL }; static gchar *id3_exts[] = - { "mp3", "mp2", "mp1", "mpga", "ogg", "flac", NULL }; + { "mp3", "mp2", "mp1", "mpga", "ogg", "flac", "tta", NULL }; + static gchar *tta_exts[] = { "tta", NULL }; static gchar *mod_exts[] = { "669", "amf", "dsm", "gdm", "far", "imf", "it", "med", "mod", "mtm", "okt", "sam", "s3m", "stm", "stx", "ult", "xm", NULL @@ -1366,6 +1385,8 @@ plugin_init (GstPlugin * plugin) flx_exts, FLX_CAPS, NULL); TYPE_FIND_REGISTER (plugin, "application/x-id3", GST_RANK_PRIMARY, id3_type_find, id3_exts, ID3_CAPS, NULL); + TYPE_FIND_REGISTER (plugin, "audio/x-tta", GST_RANK_PRIMARY, + tta_type_find, tta_exts, TTA_CAPS, NULL); TYPE_FIND_REGISTER (plugin, "audio/x-mod", GST_RANK_SECONDARY, mod_type_find, mod_exts, MOD_CAPS, NULL); TYPE_FIND_REGISTER (plugin, "audio/mpeg", GST_RANK_PRIMARY, mp3_type_find,