blob: 63c132366349c1fe28bd163522b14fbaeb29e834 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
|
diff -Naur xmms-cdread-0.14a/filter.c xmms-cdread-0.14a-endian/filter.c
--- xmms-cdread-0.14a/filter.c 2001-04-09 19:33:13.000000000 +0100
+++ xmms-cdread-0.14a-endian/filter.c 2003-10-17 22:57:34.000000000 +0100
@@ -4,6 +4,7 @@
#include <stdio.h>
#include <string.h>
#include <math.h>
+#include <endian.h>
typedef double real;
@@ -37,9 +38,18 @@
int i, j, k;
sample *data = buf;
real ol, or;
+#ifdef __BIG_ENDIAN
+ char *p;
+#endif
if (!cd_eq_on) return;
+#ifdef __BIG_ENDIAN
+ for (p = (char *)data; p < (char *)(data + len); p += 2) {
+ p[0] ^= p[1] ^= p[0] ^= p[1];
+ }
+#endif
+
for (i = 0; i < len; i++) {
ol = fc[0] * (real)data[i].l;
or = fc[0] * (real)data[i].r;
@@ -58,6 +66,13 @@
data[i].l = (short)ol;
data[i].r = (short)or;
}
+
+#ifdef __BIG_ENDIAN
+ for (p = (char *)data; p < (char *)(data + len); p += 2) {
+ p[0] ^= p[1] ^= p[0] ^= p[1];
+ }
+#endif
+
}
#define PI 3.1415926535897932384626433832795029L
|