summaryrefslogtreecommitdiffstats
path: root/osdep/swab.c
diff options
context:
space:
mode:
authorreimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2>2004-10-11 19:26:13 +0000
committerreimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2>2004-10-11 19:26:13 +0000
commit30d48cb10e8576126d9aa2e0bbc8e0a06b3896fc (patch)
tree80cc354a8b57f1746ce390b316456517d82bd59d /osdep/swab.c
parent9f0ef64532858e0101f43050c1d369c3731b8bb9 (diff)
downloadmpv-30d48cb10e8576126d9aa2e0bbc8e0a06b3896fc.tar.bz2
mpv-30d48cb10e8576126d9aa2e0bbc8e0a06b3896fc.tar.xz
Zeta OS support, mostly working.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@13613 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'osdep/swab.c')
-rw-r--r--osdep/swab.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/osdep/swab.c b/osdep/swab.c
new file mode 100644
index 0000000000..45d26cbc14
--- /dev/null
+++ b/osdep/swab.c
@@ -0,0 +1,17 @@
+#include "../config.h"
+
+#ifndef HAVE_SWAB
+/* system has no swab. emulate via bswap */
+#include "../bswap.h"
+#include <unistd.h>
+
+void swab(const void *from, void *to, ssize_t n) {
+ const int16_t *in = (int16_t*)from;
+ int16_t *out = (int16_t*)to;
+ int i;
+ n /= 2;
+ for (i = 0 ; i < n; i++) {
+ out[i] = bswap_16(in[i]);
+ }
+}
+#endif