fix for big endian machines. Chunk ID conversion was being swabbed twice.
authorDavid Schleef <ds@schleef.org>
Thu, 10 Oct 2002 22:14:54 +0000 (22:14 +0000)
committerDavid Schleef <ds@schleef.org>
Thu, 10 Oct 2002 22:14:54 +0000 (22:14 +0000)
Original commit message from CVS:
fix for big endian machines.  Chunk ID conversion was being swabbed
twice.

gst/avi/gstavidemux.c
gst/avi/gstavidemux.h

index 6b2a8ff..e8af421 100644 (file)
@@ -1316,8 +1316,8 @@ gst_avi_demux_process_chunk (GstAviDemux *avi_demux, guint64 *filepos,
                   
       stream = &avi_demux->stream[stream_id];
 
-      GST_DEBUG (0,"gst_avi_demux_chain: tag found %08x size %08x",
-                   chunkid, *chunksize);
+      GST_DEBUG (0,"gst_avi_demux_chain: tag found %08x size %08x stream_id %d",
+                   chunkid, *chunksize, stream_id);
 
       format = GST_FORMAT_TIME;
       gst_pad_query (stream->pad, GST_PAD_QUERY_POSITION, &format, &next_ts);
@@ -1332,7 +1332,7 @@ gst_avi_demux_process_chunk (GstAviDemux *avi_demux, guint64 *filepos,
        stream->skip--;
       }
       else {
-        if (GST_PAD_IS_CONNECTED (stream->pad)) {
+        if (stream->pad && GST_PAD_IS_CONNECTED (stream->pad)) {
          GstBuffer *buf;
           guint32   got_bytes;
 
index 5eb0387..7b7fac0 100644 (file)
@@ -46,8 +46,8 @@ extern "C" {
 #define GST_AVI_DEMUX_MAX_STREAMS      16      
 
 #define CHUNKID_TO_STREAMNR(chunkid) \
-  (((GUINT32_FROM_BE (chunkid) >> 24) - '0') * 10 + \
-   ((GUINT32_FROM_BE (chunkid) >> 16) & 0xff) - '0')
+  ((((chunkid) & 0xff) - '0') * 10 + \
+   (((chunkid) >> 8) & 0xff) - '0')
 
 typedef struct _GstAviDemux GstAviDemux;
 typedef struct _GstAviDemuxClass GstAviDemuxClass;