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
This commit is contained in:
Joshua C. Colp 2020-02-04 10:18:13 -04:00
parent d6574cb7c7
commit f4132eec19
1 changed files with 6 additions and 0 deletions

View File

@ -6667,6 +6667,12 @@ static int rtp_transport_wide_cc_feedback_produce(const void *data)
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 */