aboutsummaryrefslogtreecommitdiffstats
path: root/channels/chan_iax2.c
diff options
context:
space:
mode:
authorkpfleming <kpfleming@f38db490-d61c-443f-a65b-d21fe96a405b>2005-04-03 22:57:18 +0000
committerkpfleming <kpfleming@f38db490-d61c-443f-a65b-d21fe96a405b>2005-04-03 22:57:18 +0000
commit4ce1edc05cec917ad15513344d46fed1e35b6f58 (patch)
tree0377d7238fbc8640a0885f84f0b381aaef09d78c /channels/chan_iax2.c
parentbbbb1d493dfcc49a639c0d6fda114322041a4f2b (diff)
handle AST_FORMAT_SLINEAR endianness properly on big-endian systems (bug #3865)
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@5373 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'channels/chan_iax2.c')
-rwxr-xr-xchannels/chan_iax2.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/channels/chan_iax2.c b/channels/chan_iax2.c
index 6135ca4a1..6ea03392d 100755
--- a/channels/chan_iax2.c
+++ b/channels/chan_iax2.c
@@ -7337,9 +7337,12 @@ retryowner2:
f.src = "IAX2";
f.mallocd = 0;
f.offset = 0;
- if (f.datalen && (f.frametype == AST_FRAME_VOICE))
+ if (f.datalen && (f.frametype == AST_FRAME_VOICE)) {
f.samples = get_samples(&f);
- else
+ /* We need to byteswap incoming slinear samples from network byte order */
+ if (f.subclass == AST_FORMAT_SLINEAR)
+ ast_frame_byteswap_be(&f);
+ } else
f.samples = 0;
iax_frame_wrap(&fr, &f);