use GLib byte order macros
This commit is contained in:
parent
c844bd602d
commit
ac0fe98ffb
@ -358,8 +358,6 @@ AC_ARG_WITH(faad-libraries,[ --with-faad-libraries=DIR Directory where faad2
|
||||
AC_ARG_WITH(faad-includes,[ --with-faad-includes=DIR Directory where faad2 header files are installed (optional)], faad_includes="$withval", faad_includes="")
|
||||
AC_ARG_WITH(zeroconf,[[ --with-zeroconf=[auto|avahi|bonjour|no] Enable zeroconf backend (default=auto)]], with_zeroconf="$withval", with_zeroconf="auto")
|
||||
|
||||
AC_C_BIGENDIAN
|
||||
|
||||
AC_CHECK_HEADER(sys/inttypes.h,AC_DEFINE(HAVE_SYS_INTTYPES_H,1,[Define if sys/inttypes.h present]),)
|
||||
|
||||
AC_CHECK_LIB(socket,socket,MPD_LIBS="$MPD_LIBS -lsocket",)
|
||||
|
@ -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
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -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;
|
||||
|
@ -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
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user