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

Friendly Automation asteriskteam at digium.com
Wed Feb 5 09:24:41 CST 2020


Friendly Automation has submitted this change. ( 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(-)

Approvals:
  Benjamin Keith Ford: Looks good to me, but someone else must approve
  George Joseph: Looks good to me, approved
  Friendly Automation: Approved for Submit



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-Reviewer: Benjamin Keith Ford <bford at digium.com>
Gerrit-Reviewer: Friendly Automation
Gerrit-Reviewer: George Joseph <gjoseph at digium.com>
Gerrit-MessageType: merged
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20200205/5e13476a/attachment.html>


More information about the asterisk-code-review mailing list