[Asterisk-code-review] bridge_softmix & rtp_engine: Make REMB mantissa a uint64_t (...asterisk[16])

Kevin Harwell asteriskteam at digium.com
Wed Mar 27 13:05:47 CDT 2019


Kevin Harwell has uploaded this change for review. ( https://gerrit.asterisk.org/c/asterisk/+/11193


Change subject: bridge_softmix & rtp_engine: Make REMB mantissa a uint64_t
......................................................................

bridge_softmix & rtp_engine: Make REMB mantissa a uint64_t

REMB's exponent is 6-bits (0..63), however the mantissa is stored in Asterisk
as an unsigned integer, which is typically 32-bits. A higher exponent value
resulted in bits being shifted off the "front" of the mantissa, which caused
the wrong value to be sent to the browser.

This patch specifies the mantissa as an unsigned 64-bit value now, so larger
values can be accommodated.

ASTERISK-28255

Change-Id: Ice00fdd16693b16b41230664be5d9f0e465b239e
---
M bridges/bridge_softmix.c
M include/asterisk/rtp_engine.h
2 files changed, 3 insertions(+), 3 deletions(-)



  git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/93/11193/1

diff --git a/bridges/bridge_softmix.c b/bridges/bridge_softmix.c
index 290ea2b..20af951 100644
--- a/bridges/bridge_softmix.c
+++ b/bridges/bridge_softmix.c
@@ -76,7 +76,7 @@
 	/*! The REMB to send to the source which is collecting REMB reports */
 	struct ast_rtp_rtcp_feedback feedback;
 	/*! The maximum bitrate */
-	unsigned int bitrate;
+	uint64_t bitrate;
 };
 
 struct softmix_stats {
@@ -1334,7 +1334,7 @@
 	struct softmix_bridge_data *softmix_data, struct softmix_channel *sc)
 {
 	int i;
-	unsigned int bitrate;
+	uint64_t bitrate;
 
 	/* If there are no video sources that we are a receiver of then we have noone to
 	 * report REMB to.
diff --git a/include/asterisk/rtp_engine.h b/include/asterisk/rtp_engine.h
index 98d7773..4cf3eba 100644
--- a/include/asterisk/rtp_engine.h
+++ b/include/asterisk/rtp_engine.h
@@ -346,7 +346,7 @@
  * \brief A REMB feedback message (see draft-alvestrand-rmcat-remb-03 for details) */
 struct ast_rtp_rtcp_feedback_remb {
 	unsigned int br_exp;		/*!< Exponential scaling of the mantissa for the maximum total media bit rate value */
-	unsigned int br_mantissa;	/*!< The mantissa of the maximum total media bit rate */
+	uint64_t br_mantissa;		/*!< The mantissa of the maximum total media bit rate */
 };
 
 /*!

-- 
To view, visit https://gerrit.asterisk.org/c/asterisk/+/11193
To unsubscribe, or for help writing mail filters, visit https://gerrit.asterisk.org/settings

Gerrit-Project: asterisk
Gerrit-Branch: 16
Gerrit-Change-Id: Ice00fdd16693b16b41230664be5d9f0e465b239e
Gerrit-Change-Number: 11193
Gerrit-PatchSet: 1
Gerrit-Owner: Kevin Harwell <kharwell at digium.com>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20190327/616e6810/attachment.html>


More information about the asterisk-code-review mailing list