ref: 668549e1df4f77e7850e0081908c2e50f6f70c06
parent: 87c2911f3b521e5eacf08e3ec39a00a317e38a25
author: rrt <rrt>
date: Thu May 24 18:45:23 EDT 2007
Attempt to fix playback on big-endian machines (bug #421682).
--- a/src/wav.c
+++ b/src/wav.c
@@ -419,9 +419,9 @@
if (strncmp("RIFX", magic, 4) == 0)
{
sox_debug("Found RIFX header, swapping bytes");
- ft->signal.reverse_bytes = SOX_IS_LITTLEENDIAN;
+ ft->signal.reverse_bytes ^= SOX_IS_LITTLEENDIAN;
}
- else ft->signal.reverse_bytes = SOX_IS_BIGENDIAN;
+ else ft->signal.reverse_bytes ^= SOX_IS_BIGENDIAN;
sox_readdw(ft, &dwRiffLength);
@@ -1439,7 +1439,6 @@
dwAvgBytesPerSec = (double)wBlockAlign*ft->signal.rate / (double)wSamplesPerBlock + 0.5;
/* figured out header info, so write it */
-
/* If user specified opposite swap than we think, assume they are
* asking to write a RIFX file.