diff options
author | Alfred E. Heggestad <aeh@db.org> | 2014-02-09 12:04:11 +0100 |
---|---|---|
committer | Alfred E. Heggestad <aeh@db.org> | 2014-02-09 12:04:11 +0100 |
commit | cbda18d165d1ccf8ab3b503260acd4960911bf5d (patch) | |
tree | 5c3bb763328dc4a813d331014b864bf627fe9b4e /modules/oss/oss.c | |
parent | a49ed6fdade55f1c3540dcf61d3ca2fce0d6f10d (diff) |
oss: use native-endian format, so it works on big endian CPUs
tested on i386 and mips (openwrt):
--- System info: ---
Machine: mips/linux
Version: 0.4.10 (libre v0.4.7)
Build: 32-bit big endian
Kernel: Linux OpenWrt 3.3.8 #1 Sat Mar 23 16:49:30 UTC 2013
Uptime: 1 sec
Started: Thu Feb 6 19:21:28 2014
Compiler: 4.6.4
Diffstat (limited to 'modules/oss/oss.c')
-rw-r--r-- | modules/oss/oss.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/modules/oss/oss.c b/modules/oss/oss.c index 3acd9df..d7bff51 100644 --- a/modules/oss/oss.c +++ b/modules/oss/oss.c @@ -92,7 +92,7 @@ static int set_fragment(int fd, uint32_t sampc) static int oss_reset(int fd, uint32_t srate, uint8_t ch, int sampc, int nonblock) { - int format = AFMT_S16_LE; + int format = AFMT_S16_NE; /* native endian */ int speed = srate; int channels = ch; int blocksize = 0; @@ -118,8 +118,8 @@ static int oss_reset(int fd, uint32_t srate, uint8_t ch, int sampc, (void)ioctl(fd, SNDCTL_DSP_GETBLKSIZE, &blocksize); - info("oss: init: %u bit %d Hz %d ch, blocksize=%d\n", - format, speed, channels, blocksize); + info("oss: init: %d Hz %d ch, blocksize=%d\n", + speed, channels, blocksize); return 0; } |