From 14d73ce3e7644dd3645b9625b578b6a28bc54d89 Mon Sep 17 00:00:00 2001 From: David Schleef Date: Fri, 3 Oct 2003 17:01:25 +0000 Subject: [PATCH] Fix typefinding for BBB's new system Original commit message from CVS: Fix typefinding for BBB's new system --- ext/sidplay/gstsiddec.cc | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/ext/sidplay/gstsiddec.cc b/ext/sidplay/gstsiddec.cc index 17b2a54bff..4095277aa6 100644 --- a/ext/sidplay/gstsiddec.cc +++ b/ext/sidplay/gstsiddec.cc @@ -20,6 +20,8 @@ #include +#include + #include "gstsiddec.h" /* elementfactory information */ @@ -33,7 +35,7 @@ static GstElementDetails gst_siddec_details = { "(C) 2001", }; -static GstCaps* sid_typefind (GstBuffer *buf, gpointer priv); +static GstCaps* sid_typefind (GstByteStream *bs, gpointer priv); /* typefactory for 'sid' */ static GstTypeDefinition siddefinition = { @@ -184,13 +186,17 @@ gst_siddec_get_type (void) } static GstCaps* -sid_typefind (GstBuffer *buf, gpointer priv) +sid_typefind (GstByteStream *bs, gpointer priv) { - guchar *data = GST_BUFFER_DATA (buf); + guchar *data; + GstBuffer *buffer; GstCaps *newcaps; GST_DEBUG ("sid_demux: typefind"); + gst_bytestream_peek (bs, &buffer, 4); + data = GST_BUFFER_DATA (buffer); + if (strncmp ((const char *)data, "PSID", 4)) return NULL;