summaryrefslogtreecommitdiffstats
path: root/gst/mpegaudioparse/gstmpegaudioparse.c
diff options
context:
space:
mode:
authorBenjamin Otte <otte@gnome.org>2003-06-29 19:46:13 +0000
committerBenjamin Otte <otte@gnome.org>2003-06-29 19:46:13 +0000
commitf4a7caa418d3a283392b1142fe9863ae870ce3b8 (patch)
tree8d29cf94dd85acfa8cc58f5761d28a24eae14223 /gst/mpegaudioparse/gstmpegaudioparse.c
parent813b3a530e66bebe1153c8b10abc4cafc99ac772 (diff)
downloadgst-plugins-bad-f4a7caa418d3a283392b1142fe9863ae870ce3b8.tar.gz
gst-plugins-bad-f4a7caa418d3a283392b1142fe9863ae870ce3b8.tar.bz2
gst-plugins-bad-f4a7caa418d3a283392b1142fe9863ae870ce3b8.zip
compatibility fix for new GST_DEBUG stuff.
Original commit message from CVS: compatibility fix for new GST_DEBUG stuff. Includes fixes for missing includes for config.h and unistd.h I only ensured for plugins I can build that they work, so if some of them are still broken, you gotta fix them yourselves unfortunately.
Diffstat (limited to 'gst/mpegaudioparse/gstmpegaudioparse.c')
-rw-r--r--gst/mpegaudioparse/gstmpegaudioparse.c41
1 files changed, 22 insertions, 19 deletions
diff --git a/gst/mpegaudioparse/gstmpegaudioparse.c b/gst/mpegaudioparse/gstmpegaudioparse.c
index 4d0cf3a4..a5d8797c 100644
--- a/gst/mpegaudioparse/gstmpegaudioparse.c
+++ b/gst/mpegaudioparse/gstmpegaudioparse.c
@@ -18,6 +18,9 @@
*/
/*#define GST_DEBUG_ENABLED */
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
#include <gstmpegaudioparse.h>
@@ -243,7 +246,7 @@ gst_mp3parse_chain (GstPad *pad, GstBuffer *buf)
mp3parse = GST_MP3PARSE (gst_pad_get_parent (pad));
- GST_DEBUG (0,"mp3parse: received buffer of %d bytes",GST_BUFFER_SIZE(buf));
+ GST_DEBUG ("mp3parse: received buffer of %d bytes",GST_BUFFER_SIZE(buf));
last_ts = GST_BUFFER_TIMESTAMP(buf);
@@ -274,12 +277,12 @@ gst_mp3parse_chain (GstPad *pad, GstBuffer *buf)
while (offset < size-4) {
int skipped = 0;
- GST_DEBUG (0,"mp3parse: offset %ld, size %ld ",offset, size);
+ GST_DEBUG ("mp3parse: offset %ld, size %ld ",offset, size);
/* search for a possible start byte */
for (;((data[offset] != 0xff) && (offset < size));offset++) skipped++;
if (skipped && !mp3parse->in_flush) {
- GST_DEBUG (0,"mp3parse: **** now at %ld skipped %d bytes",offset,skipped);
+ GST_DEBUG ("mp3parse: **** now at %ld skipped %d bytes",offset,skipped);
}
/* construct the header word */
header = GUINT32_FROM_BE(*((guint32 *)(data+offset)));
@@ -306,12 +309,12 @@ gst_mp3parse_chain (GstPad *pad, GstBuffer *buf)
if ((size-offset)<(bpf+4)) { if (mp3parse->in_flush) break; } /* wait until we have the the entire current frame as well as the next frame header */
header2 = GUINT32_FROM_BE(*((guint32 *)(data+offset+bpf)));
- GST_DEBUG(0,"mp3parse: header=%08X, header2=%08X, bpf=%d", (unsigned int)header, (unsigned int)header2, bpf );
+ GST_DEBUG ("mp3parse: header=%08X, header2=%08X, bpf=%d", (unsigned int)header, (unsigned int)header2, bpf );
#define HDRMASK ~( (0xF<<12)/*bitrate*/ | (1<<9)/*padding*/ | (3<<4)/*mode extension*/ ) /* mask the bits which are allowed to differ between frames */
if ( (header2&HDRMASK) != (header&HDRMASK) ) { /* require 2 matching headers in a row */
- GST_DEBUG(0,"mp3parse: next header doesn't match (header=%08X, header2=%08X, bpf=%d)", (unsigned int)header, (unsigned int)header2, bpf );
+ GST_DEBUG ("mp3parse: next header doesn't match (header=%08X, header2=%08X, bpf=%d)", (unsigned int)header, (unsigned int)header2, bpf );
offset++; /* This frame is invalid. Start looking for a valid frame at the next position in the stream */
continue;
}
@@ -320,7 +323,7 @@ gst_mp3parse_chain (GstPad *pad, GstBuffer *buf)
/* if we don't have the whole frame... */
if ((size - offset) < bpf) {
- GST_DEBUG (0,"mp3parse: partial buffer needed %ld < %d ",(size-offset), bpf);
+ GST_DEBUG ("mp3parse: partial buffer needed %ld < %d ",(size-offset), bpf);
break;
} else {
@@ -328,7 +331,7 @@ gst_mp3parse_chain (GstPad *pad, GstBuffer *buf)
offset += bpf;
if (mp3parse->skip == 0) {
- GST_DEBUG (0,"mp3parse: pushing buffer of %d bytes",GST_BUFFER_SIZE(outbuf));
+ GST_DEBUG ("mp3parse: pushing buffer of %d bytes",GST_BUFFER_SIZE(outbuf));
if (mp3parse->in_flush) {
/* FIXME do some sort of flush event */
mp3parse->in_flush = FALSE;
@@ -337,21 +340,21 @@ gst_mp3parse_chain (GstPad *pad, GstBuffer *buf)
gst_pad_push(mp3parse->srcpad,outbuf);
}
else {
- GST_DEBUG (0,"mp3parse: skipping buffer of %d bytes",GST_BUFFER_SIZE(outbuf));
+ GST_DEBUG ("mp3parse: skipping buffer of %d bytes",GST_BUFFER_SIZE(outbuf));
gst_buffer_unref(outbuf);
mp3parse->skip--;
}
}
} else {
offset++;
- if (!mp3parse->in_flush) GST_DEBUG (0,"mp3parse: *** wrong header, skipping byte (FIXME?)");
+ if (!mp3parse->in_flush) GST_DEBUG ("mp3parse: *** wrong header, skipping byte (FIXME?)");
}
}
/* if we have processed this block and there are still */
/* bytes left not in a partial block, copy them over. */
if (size-offset > 0) {
glong remainder = (size - offset);
- GST_DEBUG (0,"mp3parse: partial buffer needed %ld for trailing bytes",remainder);
+ GST_DEBUG ("mp3parse: partial buffer needed %ld for trailing bytes",remainder);
outbuf = gst_buffer_create_sub(mp3parse->partialbuf,offset,remainder);
gst_buffer_unref(mp3parse->partialbuf);
@@ -409,28 +412,28 @@ bpf_from_header (GstMPEGAudioParse *parse, unsigned long header)
static gboolean
head_check (unsigned long head)
{
- GST_DEBUG (0,"checking mp3 header 0x%08lx",head);
+ GST_DEBUG ("checking mp3 header 0x%08lx",head);
/* if it's not a valid sync */
if ((head & 0xffe00000) != 0xffe00000) {
- GST_DEBUG (0,"invalid sync");return FALSE; }
+ GST_DEBUG ("invalid sync");return FALSE; }
/* if it's an invalid MPEG version */
if (((head >> 19) & 3) == 0x1) {
- GST_DEBUG (0,"invalid MPEG version");return FALSE; }
+ GST_DEBUG ("invalid MPEG version");return FALSE; }
/* if it's an invalid layer */
if (!((head >> 17) & 3)) {
- GST_DEBUG (0,"invalid layer");return FALSE; }
+ GST_DEBUG ("invalid layer");return FALSE; }
/* if it's an invalid bitrate */
if (((head >> 12) & 0xf) == 0x0) {
- GST_DEBUG (0,"invalid bitrate");return FALSE; }
+ GST_DEBUG ("invalid bitrate");return FALSE; }
if (((head >> 12) & 0xf) == 0xf) {
- GST_DEBUG (0,"invalid bitrate");return FALSE; }
+ GST_DEBUG ("invalid bitrate");return FALSE; }
/* if it's an invalid samplerate */
if (((head >> 10) & 0x3) == 0x3) {
- GST_DEBUG (0,"invalid samplerate");return FALSE; }
+ GST_DEBUG ("invalid samplerate");return FALSE; }
if ((head & 0xffff0000) == 0xfffe0000) {
- GST_DEBUG (0,"invalid sync");return FALSE; }
+ GST_DEBUG ("invalid sync");return FALSE; }
if (head & 0x00000002) {
- GST_DEBUG (0,"invalid emphasis");return FALSE; }
+ GST_DEBUG ("invalid emphasis");return FALSE; }
return TRUE;
}