mirror of
https://github.com/asterisk/asterisk.git
synced 2025-10-12 15:45:18 +00:00
fix endianness (bug #3839)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/v1-0@5333 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -34,6 +34,7 @@
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <endian.h>
|
||||
#ifdef __linux
|
||||
#include <linux/soundcard.h>
|
||||
#elif defined(__FreeBSD__)
|
||||
@@ -322,7 +323,13 @@ static int setformat(void)
|
||||
int fmt, desired, res, fd = sounddev;
|
||||
static int warnedalready = 0;
|
||||
static int warnedalready2 = 0;
|
||||
|
||||
#if __BYTE_ORDER == __LITTLE_ENDIAN
|
||||
fmt = AFMT_S16_LE;
|
||||
#else
|
||||
fmt = AFMT_S16_BE;
|
||||
#endif
|
||||
|
||||
res = ioctl(fd, SNDCTL_DSP_SETFMT, &fmt);
|
||||
if (res < 0) {
|
||||
ast_log(LOG_WARNING, "Unable to set format to 16-bit signed\n");
|
||||
|
Reference in New Issue
Block a user