<p>Joshua Colp <strong>submitted</strong> this change.</p><p><a href="https://gerrit.asterisk.org/c/asterisk/+/14208">View Change</a></p><div style="white-space:pre-wrap">Approvals:
Joshua Colp: Looks good to me, approved; Approved for Submit
Benjamin Keith Ford: Looks good to me, but someone else must approve
George Joseph: Looks good to me, but someone else must approve
</div><pre style="font-family: monospace,monospace; white-space: pre-wrap;">res_rtp_asterisk: Resolve loop when receive buffer is flushed<br><br>When the receive buffer was flushed by a received packet while it<br>already contained a packet with the same sequence number, Asterisk<br>never left the while loop which tried to order the packets.<br><br>This change makes it so if the packet is in the receive buffer it<br>is retrieved and freed allowing the buffer to empty.<br><br>ASTERISK-28827<br><br>Change-Id: Idaa376101bc1ac880047c49feb6faee773e718b3<br>---<br>M res/res_rtp_asterisk.c<br>1 file changed, 8 insertions(+), 0 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/res/res_rtp_asterisk.c b/res/res_rtp_asterisk.c</span><br><span>index 5dd5d35..75be561 100644</span><br><span>--- a/res/res_rtp_asterisk.c</span><br><span>+++ b/res/res_rtp_asterisk.c</span><br><span>@@ -7835,6 +7835,14 @@</span><br><span> ast_debug(2, "Inserted just received packet with sequence number '%d' in correct order on RTP instance '%p'\n",</span><br><span> seqno, instance);</span><br><span> }</span><br><span style="color: hsl(120, 100%, 40%);">+ /* It is possible due to packet retransmission for this packet to also exist in the receive</span><br><span style="color: hsl(120, 100%, 40%);">+ * buffer so we explicitly remove it in case this occurs, otherwise the receive buffer will</span><br><span style="color: hsl(120, 100%, 40%);">+ * never be empty.</span><br><span style="color: hsl(120, 100%, 40%);">+ */</span><br><span style="color: hsl(120, 100%, 40%);">+ payload = (struct ast_rtp_rtcp_nack_payload *)ast_data_buffer_remove(rtp->recv_buffer, seqno);</span><br><span style="color: hsl(120, 100%, 40%);">+ if (payload) {</span><br><span style="color: hsl(120, 100%, 40%);">+ ast_free(payload);</span><br><span style="color: hsl(120, 100%, 40%);">+ }</span><br><span> rtp->expectedrxseqno++;</span><br><span> if (rtp->expectedrxseqno == SEQNO_CYCLE_OVER) {</span><br><span> rtp->expectedrxseqno = 0;</span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.asterisk.org/c/asterisk/+/14208">change 14208</a>. To unsubscribe, or for help writing mail filters, visit <a href="https://gerrit.asterisk.org/settings">settings</a>.</p><div itemscope itemtype="http://schema.org/EmailMessage"><div itemscope itemprop="action" itemtype="http://schema.org/ViewAction"><link itemprop="url" href="https://gerrit.asterisk.org/c/asterisk/+/14208"/><meta itemprop="name" content="View Change"/></div></div>
<div style="display:none"> Gerrit-Project: asterisk </div>
<div style="display:none"> Gerrit-Branch: 16 </div>
<div style="display:none"> Gerrit-Change-Id: Idaa376101bc1ac880047c49feb6faee773e718b3 </div>
<div style="display:none"> Gerrit-Change-Number: 14208 </div>
<div style="display:none"> Gerrit-PatchSet: 4 </div>
<div style="display:none"> Gerrit-Owner: nappsoft <infos@nappsoft.ch> </div>
<div style="display:none"> Gerrit-Reviewer: Benjamin Keith Ford <bford@digium.com> </div>
<div style="display:none"> Gerrit-Reviewer: Friendly Automation </div>
<div style="display:none"> Gerrit-Reviewer: George Joseph <gjoseph@digium.com> </div>
<div style="display:none"> Gerrit-Reviewer: Joshua Colp <jcolp@sangoma.com> </div>
<div style="display:none"> Gerrit-MessageType: merged </div>