diff options
author | Max Kellermann <max@duempel.org> | 2009-01-05 08:17:22 +0100 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2009-01-05 08:17:22 +0100 |
commit | ac0fe98ffb9efc1bb7faf6110ec728424003ba42 (patch) | |
tree | 72719dcb49d47c90f38c6a618550a5c1d1dee1cf /src | |
parent | c844bd602dc6b92f53e7ec7baf20062404bf5683 (diff) | |
download | mpd-ac0fe98ffb9efc1bb7faf6110ec728424003ba42.tar.gz mpd-ac0fe98ffb9efc1bb7faf6110ec728424003ba42.tar.xz mpd-ac0fe98ffb9efc1bb7faf6110ec728424003ba42.zip |
use GLib byte order macros
Diffstat (limited to '')
-rw-r--r-- | src/decoder/oggvorbis_plugin.c | 2 | ||||
-rw-r--r-- | src/output/mvp_plugin.c | 13 | ||||
-rw-r--r-- | src/output/oss_plugin.c | 4 | ||||
-rw-r--r-- | src/output/osx_plugin.c | 2 |
4 files changed, 11 insertions, 10 deletions
diff --git a/src/decoder/oggvorbis_plugin.c b/src/decoder/oggvorbis_plugin.c index 8dfb3e5d0..575767429 100644 --- a/src/decoder/oggvorbis_plugin.c +++ b/src/decoder/oggvorbis_plugin.c @@ -40,7 +40,7 @@ #include <stdlib.h> #include <unistd.h> -#ifdef WORDS_BIGENDIAN +#ifdef G_BYTE_ORDER == G_BIG_ENDIAN #define OGG_DECODE_USE_BIGENDIAN 1 #else #define OGG_DECODE_USE_BIGENDIAN 0 diff --git a/src/output/mvp_plugin.c b/src/output/mvp_plugin.c index 8972e338b..f2a97257f 100644 --- a/src/output/mvp_plugin.c +++ b/src/output/mvp_plugin.c @@ -34,6 +34,12 @@ #undef G_LOG_DOMAIN #define G_LOG_DOMAIN "mvp" +#ifdef G_BYTE_ORDER == G_BIG_ENDIAN +#define MVP_USE_LITTLE_ENDIAN false +#else +#define MVP_USE_LITTLE_ENDIAN true +#endif + typedef struct { unsigned long dsp_status; unsigned long stream_decode_type; @@ -218,13 +224,8 @@ mvp_openDevice(void *data, struct audio_format *audioFormat) strerror(errno)); return false; } -#ifdef WORDS_BIGENDIAN mvp_setPcmParams(md, audioFormat->sample_rate, audioFormat->channels, - 0, audioFormat->bits); -#else - mvp_setPcmParams(md, audioFormat->sample_rate, audioFormat->channels, - 1, audioFormat->bits); -#endif + MVP_USE_LITTLE_ENDIAN, audioFormat->bits); md->audio_format = *audioFormat; return true; } diff --git a/src/output/oss_plugin.c b/src/output/oss_plugin.c index 98d0fd94d..95b1b9063 100644 --- a/src/output/oss_plugin.c +++ b/src/output/oss_plugin.c @@ -40,11 +40,11 @@ # include <sys/soundcard.h> #endif /* !(defined(__OpenBSD__) || defined(__NetBSD__) */ -#ifdef WORDS_BIGENDIAN +#ifdef G_BYTE_ORDER == G_BIG_ENDIAN # define AFMT_S16_MPD AFMT_S16_BE #else # define AFMT_S16_MPD AFMT_S16_LE -#endif /* WORDS_BIGENDIAN */ +#endif typedef struct _OssData { int fd; diff --git a/src/output/osx_plugin.c b/src/output/osx_plugin.c index ad4128d34..43d81bd76 100644 --- a/src/output/osx_plugin.c +++ b/src/output/osx_plugin.c @@ -264,7 +264,7 @@ osx_openDevice(void *data, struct audio_format *audioFormat) streamDesc.mSampleRate = audioFormat->sample_rate; streamDesc.mFormatID = kAudioFormatLinearPCM; streamDesc.mFormatFlags = kLinearPCMFormatFlagIsSignedInteger; -#ifdef WORDS_BIGENDIAN +#ifdef G_BYTE_ORDER == G_BIG_ENDIAN streamDesc.mFormatFlags |= kLinearPCMFormatFlagIsBigEndian; #endif |