mirror of
https://github.com/asterisk/asterisk.git
synced 2025-11-16 14:58:25 +00:00
handle AST_FORMAT_SLINEAR endianness properly on big-endian systems (bug #3865)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@5373 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -855,8 +855,15 @@ void iax_frame_wrap(struct iax_frame *fr, struct ast_frame *f)
|
||||
fr->af.delivery.tv_sec = 0;
|
||||
fr->af.delivery.tv_usec = 0;
|
||||
fr->af.data = fr->afdata;
|
||||
if (fr->af.datalen)
|
||||
if (fr->af.datalen) {
|
||||
#if __BYTE_ORDER == __LITTLE_ENDIAN
|
||||
/* We need to byte-swap slinear samples from network byte order */
|
||||
if (fr->af.subclass == AST_FORMAT_SLINEAR) {
|
||||
ast_memcpy_byteswap(fr->af.data, f->data, fr->af.samples);
|
||||
} else
|
||||
#endif
|
||||
memcpy(fr->af.data, f->data, fr->af.datalen);
|
||||
}
|
||||
}
|
||||
|
||||
struct iax_frame *iax_frame_new(int direction, int datalen)
|
||||
|
||||
Reference in New Issue
Block a user