summaryrefslogtreecommitdiffstats
path: root/gst/flx/gstflxdec.c
diff options
context:
space:
mode:
authorZeeshan Ali <zeenix@gmail.com>2005-12-11 16:43:42 +0000
committerZeeshan Ali <zeenix@gmail.com>2005-12-11 16:43:42 +0000
commit8b6d639c5dec7e488792ca67c70d9fda161ac0ce (patch)
tree23ef6b3d3b5bd5b1a534bda52985e29e715b8b63 /gst/flx/gstflxdec.c
parent81e11ca107dfb6efea2fea28a7186d2180cc3374 (diff)
Now flxdec works on big-endian machines as well.
Original commit message from CVS: Now flxdec works on big-endian machines as well.
Diffstat (limited to 'gst/flx/gstflxdec.c')
-rw-r--r--gst/flx/gstflxdec.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/gst/flx/gstflxdec.c b/gst/flx/gstflxdec.c
index 3c0cc069..0e6a9dd9 100644
--- a/gst/flx/gstflxdec.c
+++ b/gst/flx/gstflxdec.c
@@ -211,6 +211,7 @@ flx_decode_chunks (GstFlxDec * flxdec, gulong count, guchar * data,
while (count--) {
hdr = (FlxFrameChunk *) data;
+ FLX_FRAME_CHUNK_FIX_ENDIANNESS (hdr);
data += FlxFrameChunkSize;
switch (hdr->id) {
@@ -466,6 +467,7 @@ gst_flxdec_chain (GstPad * pad, GstBuffer * buf)
const guint8 *data = gst_adapter_peek (flxdec->adapter, FlxHeaderSize);
memcpy ((gchar *) & flxdec->hdr, data, FlxHeaderSize);
+ FLX_HDR_FIX_ENDIANNESS (&(flxdec->hdr));
gst_adapter_flush (flxdec->adapter, FlxHeaderSize);
flxh = &flxdec->hdr;
@@ -474,7 +476,7 @@ gst_flxdec_chain (GstPad * pad, GstBuffer * buf)
if (flxh->type != FLX_MAGICHDR_FLI &&
flxh->type != FLX_MAGICHDR_FLC && flxh->type != FLX_MAGICHDR_FLX) {
GST_ELEMENT_ERROR (flxdec, STREAM, WRONG_TYPE, (NULL),
- ("not a flx file (type %d)\n", flxh->type));
+ ("not a flx file (type %x)\n", flxh->type));
return GST_FLOW_ERROR;
}
@@ -537,6 +539,7 @@ gst_flxdec_chain (GstPad * pad, GstBuffer * buf)
const guint8 *data =
gst_adapter_peek (flxdec->adapter, FlxFrameChunkSize);
memcpy (&flxfh, data, FlxFrameChunkSize);
+ FLX_FRAME_CHUNK_FIX_ENDIANNESS (&flxfh);
switch (flxfh.id) {
case FLX_FRAME_TYPE:
@@ -550,6 +553,7 @@ gst_flxdec_chain (GstPad * pad, GstBuffer * buf)
chunk = g_memdup (data, flxfh.size - FlxFrameChunkSize);
to_flush = flxfh.size - FlxFrameChunkSize;
+ FLX_FRAME_TYPE_FIX_ENDIANNESS ((FlxFrameType *) chunk);
if (((FlxFrameType *) chunk)->chunks == 0)
break;