[Asterisk-code-review] res rtp asterisk: Swap byte-order when sending signed linear (asterisk[13])

Sean Bright asteriskteam at digium.com
Mon Jan 30 09:08:12 CST 2017


Sean Bright has uploaded a new change for review. ( https://gerrit.asterisk.org/4843 )

Change subject: res_rtp_asterisk:  Swap byte-order when sending signed linear
......................................................................

res_rtp_asterisk:  Swap byte-order when sending signed linear

Before Asterisk 13, signed linear was converted into network byte order by a
smoother before being sent over the network. The smoother is no longer created
when no packetization information is supplied to Asterisk, so instead we hard
code a check for signed linear. We already do this on the read side of the RTP
session, this change adds it on the write side as well.

ASTERISK-24858 #close
Reported-by: Frankie Chin

Change-Id: I868449617d1a7819578f218c8c6b2111ad84f5a9
---
M res/res_rtp_asterisk.c
1 file changed, 4 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/43/4843/1

diff --git a/res/res_rtp_asterisk.c b/res/res_rtp_asterisk.c
index 43d0ae2..e409c98 100644
--- a/res/res_rtp_asterisk.c
+++ b/res/res_rtp_asterisk.c
@@ -3668,6 +3668,10 @@
 			f = frame;
 		}
 		if (f->data.ptr) {
+			/* L16 is network byte order, slinear is not */
+			if (ast_format_cache_is_slinear(f->subclass.format)) {
+				ast_frame_byteswap_be(f);
+			}
 			ast_rtp_raw_write(instance, f, codec);
 		}
 		if (f != frame) {

-- 
To view, visit https://gerrit.asterisk.org/4843
To unsubscribe, visit https://gerrit.asterisk.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I868449617d1a7819578f218c8c6b2111ad84f5a9
Gerrit-PatchSet: 1
Gerrit-Project: asterisk
Gerrit-Branch: 13
Gerrit-Owner: Sean Bright <sean.bright at gmail.com>



More information about the asterisk-code-review mailing list