aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorQball Cow <qball@qballcow.nl>2007-08-19 16:26:52 +0000
committerQball Cow <qball@qballcow.nl>2007-08-19 16:26:52 +0000
commit81d77d0cf13fb3c937eded462e0f42095de71281 (patch)
tree3f2558313e167b54d6f77bf10021a43917e5c548
parent07be5b7e496fc0ac027b7b9e90c0470c914cbbaf (diff)
downloadmpd-81d77d0cf13fb3c937eded462e0f42095de71281.tar.gz
mpd-81d77d0cf13fb3c937eded462e0f42095de71281.tar.xz
mpd-81d77d0cf13fb3c937eded462e0f42095de71281.zip
endian fix
git-svn-id: https://svn.musicpd.org/mpd/branches/q-mpd@6760 09075e82-0dd4-0310-85a5-a0d7c8717e4f
-rw-r--r--src/inputPlugins/wavpack_plugin.c22
1 files changed, 21 insertions, 1 deletions
diff --git a/src/inputPlugins/wavpack_plugin.c b/src/inputPlugins/wavpack_plugin.c
index 1d056dcd7..45e7dba78 100644
--- a/src/inputPlugins/wavpack_plugin.c
+++ b/src/inputPlugins/wavpack_plugin.c
@@ -76,8 +76,14 @@ static void format_samples_int(int Bps, void *buffer, uint32_t samcnt)
break;
case 2:
while (samcnt--) {
- *dst++ = (uchar)(temp = *src++);
+ temp = *src++;
+#ifdef WORDS_BIGENDIAN
+ *dst++ = (uchar)(temp >> 8);
+ *dst++ = (uchar)(temp);
+#else
+ *dst++ = (uchar)(temp);
*dst++ = (uchar)(temp >> 8);
+#endif
}
break;
case 3:
@@ -86,14 +92,28 @@ static void format_samples_int(int Bps, void *buffer, uint32_t samcnt)
temp = *src++;
*dst++ = (uchar)(temp >> 8);
*dst++ = (uchar)(temp >> 16);
+#ifdef WORDS_BIGENDIAN
+ *dst++ = (uchar)(temp >> 16);
+ *dst++ = (uchar)(temp >> 8);
+
+#else
+ *dst++ = (uchar)(temp >> 8);
+ *dst++ = (uchar)(temp >> 16);
+#endif
}
break;
case 4:
/* downscale to 16 bits */
while (samcnt--) {
temp = *src++;
+#ifdef WORDS_BIGENDIAN
+ *dst++ = (uchar)(temp >> 24);
+ *dst++ = (uchar)(temp >> 16);
+
+#else
*dst++ = (uchar)(temp >> 16);
*dst++ = (uchar)(temp >> 24);
+#endif
}
break;
}