summaryrefslogtreecommitdiffstats
path: root/gst/auparse
diff options
context:
space:
mode:
authorRonald S. Bultje <rbultje@ronald.bitfreak.net>2003-10-01 13:14:52 +0000
committerRonald S. Bultje <rbultje@ronald.bitfreak.net>2003-10-01 13:14:52 +0000
commit38946080fd20c3b73154685b10c29aa22fac69c3 (patch)
treee8a6e28a1fe368867ea663058fbd2dbc2b9d5e44 /gst/auparse
parent9905c2c25794875043af52aeff8cffad95faa5de (diff)
New typefind system: bytestream is now part of the core all plugins have been modified to use this new typefind syste...
Original commit message from CVS: New typefind system: * bytestream is now part of the core * all plugins have been modified to use this new typefind system * asf typefinding added * mpeg video stream typefiding removed because it's broken * duplicate typefind entries removed * extra id3 typefinding added, because we've seen 4 types of files (riff/wav, flac, vorbis, mp3) with id3 headers and each of these needs to work. Instead, I've added an id3 element and let it redo typefiding after the id3 header. this needs a hack because spider only typefinds once. We can remove this hack once spider supports multiple typefinds. * with all this, mp3 typefinding is semi-rewritten * id3 typefinding in flac/vorbis is removed, it's no longer needed * fixed spider and gst-typefind to use this, too. * Other general cleanups
Diffstat (limited to 'gst/auparse')
-rw-r--r--gst/auparse/gstauparse.c19
1 files changed, 13 insertions, 6 deletions
diff --git a/gst/auparse/gstauparse.c b/gst/auparse/gstauparse.c
index 422ee1ba..f2ce8c85 100644
--- a/gst/auparse/gstauparse.c
+++ b/gst/auparse/gstauparse.c
@@ -42,16 +42,23 @@ static GstElementDetails gst_auparse_details = {
};
static GstCaps*
-au_type_find (GstBuffer *buf, gpointer private)
+au_type_find (GstByteStream *bs, gpointer private)
{
+ GstBuffer *buf = NULL;
GstCaps *new = NULL;
- gulong *head = (gulong *) GST_BUFFER_DATA (buf);
- if (GST_BUFFER_SIZE (buf) < 4)
- return NULL;
+ if (gst_bytestream_peek (bs, &buf, 4) == 4) {
+ guint32 head = * (guint32 *) GST_BUFFER_DATA (buf);
+ if (head == 0x2e736e64 || head == 0x646e732e) {
+ new = gst_caps_new ("au_type_find",
+ "audio/x-au",
+ NULL);
+ }
+ }
- if (*head == 0x2e736e64 || *head == 0x646e732e)
- new = gst_caps_new ("au_type_find", "audio/x-au", NULL);
+ if (buf != NULL) {
+ gst_buffer_unref (buf);
+ }
return new;
}