aboutsummaryrefslogtreecommitdiffstats
path: root/src/pcm
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2013-10-16 21:09:19 +0200
committerMax Kellermann <max@duempel.org>2013-10-16 22:09:44 +0200
commit5e26e2ab1dadb1e4176d5a4cac03100a7d21c22f (patch)
treefccf16ec9b798ab06913250073e003b2830d2817 /src/pcm
parent08eca827b659f2becc872c151919948b5a9ffe4d (diff)
downloadmpd-5e26e2ab1dadb1e4176d5a4cac03100a7d21c22f.tar.gz
mpd-5e26e2ab1dadb1e4176d5a4cac03100a7d21c22f.tar.xz
mpd-5e26e2ab1dadb1e4176d5a4cac03100a7d21c22f.zip
system/ByteOrder: new library for byte ordering / endianess
Replacing GLib macros.
Diffstat (limited to 'src/pcm')
-rw-r--r--src/pcm/PcmPack.cxx9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/pcm/PcmPack.cxx b/src/pcm/PcmPack.cxx
index fa020bf63..8920eb288 100644
--- a/src/pcm/PcmPack.cxx
+++ b/src/pcm/PcmPack.cxx
@@ -18,15 +18,14 @@
*/
#include "PcmPack.hxx"
-
-#include <glib.h>
+#include "system/ByteOrder.hxx"
static void
pack_sample(uint8_t *dest, const int32_t *src0)
{
const uint8_t *src = (const uint8_t *)src0;
- if (G_BYTE_ORDER == G_BIG_ENDIAN)
+ if (IsBigEndian())
++src;
*dest++ = *src++;
@@ -51,7 +50,7 @@ unpack_sample(int32_t *dest0, const uint8_t *src)
{
uint8_t *dest = (uint8_t *)dest0;
- if (G_BYTE_ORDER == G_BIG_ENDIAN)
+ if (IsBigEndian())
/* extend the sign bit to the most fourth byte */
*dest++ = *src & 0x80 ? 0xff : 0x00;
@@ -59,7 +58,7 @@ unpack_sample(int32_t *dest0, const uint8_t *src)
*dest++ = *src++;
*dest++ = *src;
- if (G_BYTE_ORDER == G_LITTLE_ENDIAN)
+ if (IsLittleEndian())
/* extend the sign bit to the most fourth byte */
*dest++ = *src & 0x80 ? 0xff : 0x00;
}