]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
Revert "Revert "res_rtp_asterisk: Resolve loop when receive buffer is flushed""
authorJoshua Colp <jcolp@sangoma.com>
Wed, 29 Apr 2020 20:43:21 +0000 (15:43 -0500)
committerFriendly Automation <jenkins2@gerrit.asterisk.org>
Thu, 30 Apr 2020 14:59:32 +0000 (09:59 -0500)
This reverts commit a75317ce247b913d1cb92b9ffa47a49aa56b172a.

Reason for revert: This will be merged once 16.8-cert1 is released.

Change-Id: Ic2f4dbb19c5756fabe71b9e35c5a924214f5af08

res/res_rtp_asterisk.c

index a5b7106345ed1da28914d74bd2cf3f8ebfa4c730..e3f4e544410b0c64eeb89aa06f4dd8f35bf89103 100644 (file)
@@ -7734,6 +7734,14 @@ static struct ast_frame *ast_rtp_read(struct ast_rtp_instance *instance, int rtc
                                        ast_debug(2, "Inserted just received packet with sequence number '%d' in correct order on RTP instance '%p'\n",
                                                seqno, instance);
                                }
+                               /* It is possible due to packet retransmission for this packet to also exist in the receive
+                                * buffer so we explicitly remove it in case this occurs, otherwise the receive buffer will
+                                * never be empty.
+                                */
+                               payload = (struct ast_rtp_rtcp_nack_payload *)ast_data_buffer_remove(rtp->recv_buffer, seqno);
+                               if (payload) {
+                                       ast_free(payload);
+                               }
                                rtp->expectedrxseqno++;
                                if (rtp->expectedrxseqno == SEQNO_CYCLE_OVER) {
                                        rtp->expectedrxseqno = 0;