[Asterisk-code-review] res_rtp_asterisk: Don't produce transport-cc if no packets. (asterisk[16])

Joshua Colp asteriskteam at digium.com
Tue Feb 4 08:19:16 CST 2020


Joshua Colp has uploaded this change for review. ( https://gerrit.asterisk.org/c/asterisk/+/13724 )


Change subject: res_rtp_asterisk: Don't produce transport-cc if no packets.
......................................................................

res_rtp_asterisk: Don't produce transport-cc if no packets.

The code assumed that when the transport-cc feedback
function was called at least one packet will have been
received. In practice this isn't always true, so now
we just reschedule the sending and do nothing.

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



  git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/24/13724/1

diff --git a/res/res_rtp_asterisk.c b/res/res_rtp_asterisk.c
index 916a616..b4528f1 100644
--- a/res/res_rtp_asterisk.c
+++ b/res/res_rtp_asterisk.c
@@ -6667,6 +6667,12 @@
 
 	ao2_lock(instance);
 
+	/* If no packets have been received then do nothing */
+	if (!AST_VECTOR_SIZE(&rtp->transport_wide_cc.packet_statistics)) {
+		ao2_unlock(instance);
+		return 1000;
+	}
+
 	rtcpheader = (unsigned char *)bdata;
 
 	/* The first packet in the vector acts as our base sequence number and reference time */

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

Gerrit-Project: asterisk
Gerrit-Branch: 16
Gerrit-Change-Id: Iabe7b358704da446fc3b0596b847bff8b8a0da6a
Gerrit-Change-Number: 13724
Gerrit-PatchSet: 1
Gerrit-Owner: Joshua Colp <jcolp at sangoma.com>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20200204/43653c93/attachment.html>


More information about the asterisk-code-review mailing list