summaryrefslogtreecommitdiffstats
path: root/gst/modplug
diff options
context:
space:
mode:
Diffstat (limited to 'gst/modplug')
-rw-r--r--gst/modplug/gstmodplug.cc56
-rw-r--r--gst/modplug/gstmodplug.h2
2 files changed, 33 insertions, 25 deletions
diff --git a/gst/modplug/gstmodplug.cc b/gst/modplug/gstmodplug.cc
index 2fa602f7..07a09a1c 100644
--- a/gst/modplug/gstmodplug.cc
+++ b/gst/modplug/gstmodplug.cc
@@ -130,31 +130,39 @@ static GstElementStateReturn
static GstElementClass *parent_class = NULL;
static GstCaps*
-modplug_type_find (GstBuffer *buf, gpointer priv)
-{
- if (GST_BUFFER_SIZE (buf) < 75)
- return NULL;
-
- if (MOD_CheckType (buf) ||
- Mod_669_CheckType (buf) ||
- Amf_CheckType (buf) ||
- Dsm_CheckType (buf) ||
- Fam_CheckType (buf) ||
- Gdm_CheckType (buf) ||
- Imf_CheckType (buf) ||
- It_CheckType (buf) ||
- M15_CheckType (buf) ||
- /*Med_CheckType (buf) || <- FIXME */
- Mtm_CheckType (buf) ||
- Okt_CheckType (buf) ||
- S3m_CheckType (buf) ||
- Xm_CheckType (buf)) {
- return gst_caps_new ("modplug_type_find",
- "audio/x-mod",
- NULL);
+modplug_type_find (GstByteStream *bs, gpointer priv)
+{
+ GstBuffer *buf = NULL;
+ GstCaps *newc = NULL;
+
+ if (gst_bytestream_peek (bs, &buf, 75) == 75) {
+ if (MOD_CheckType (buf) ||
+ Mod_669_CheckType (buf) ||
+ Amf_CheckType (buf) ||
+ Dsm_CheckType (buf) ||
+ Fam_CheckType (buf) ||
+ Gdm_CheckType (buf) ||
+ Imf_CheckType (buf) ||
+ It_CheckType (buf) ||
+ M15_CheckType (buf) ||
+#if 0
+ Med_CheckType (buf) || /* FIXME */
+#endif
+ Mtm_CheckType (buf) ||
+ Okt_CheckType (buf) ||
+ S3m_CheckType (buf) ||
+ Xm_CheckType (buf)) {
+ newc = GST_CAPS_NEW ("modplug_type_find",
+ "audio/x-mod",
+ NULL);
+ }
}
-
- return NULL;
+
+ if (buf != NULL) {
+ gst_buffer_unref (buf);
+ }
+
+ return newc;
}
static GstTypeDefinition modplug_definitions[] = {
diff --git a/gst/modplug/gstmodplug.h b/gst/modplug/gstmodplug.h
index 97d6d00e..dcdbf062 100644
--- a/gst/modplug/gstmodplug.h
+++ b/gst/modplug/gstmodplug.h
@@ -28,7 +28,7 @@ extern "C" {
#endif /* __cplusplus */
#include <gst/gst.h>
-#include <gst/bytestream/bytestream.h>
+#include <gst/gstbytestream.h>
#include "modplug_types.h"