aboutsummaryrefslogtreecommitdiffstats
path: root/src/pcm
diff options
context:
space:
mode:
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;
}