added big endian handling
authorkramm <kramm>
Thu, 11 Nov 2004 09:34:22 +0000 (09:34 +0000)
committerkramm <kramm>
Thu, 11 Nov 2004 09:34:22 +0000 (09:34 +0000)
src/wav2swf.c

index 87cb005..f6d3b2c 100644 (file)
@@ -238,6 +238,13 @@ int main (int argc,char ** argv)
     samples = (U16*)wav2.data;
     numsamples = wav2.size/2;
 
+#ifdef WORDS_BIGENDIAN
+    /* swap bytes */
+    for(t=0;t<numsamples;t++) {
+        samples[t] = (samples[t]>>8)&0xff | (samples[t]<<8)&0xff00;
+    }
+#endif
+
     if(numsamples%blocksize != 0)
     {
        // apply padding, so that block is a multiple of blocksize