<p>sungtae kim has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.asterisk.org/10993">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">Fixed wrong RTT calculation<br><br>Currently, when the Asterisk calculating a RTT for the RTCPReceived<br>event, it combinging wrong types of variables. Fixed to make the<br>correct calculation.<br><br>Change-Id: Id48b8ba1aba7c08b836ee526bf2619243379015f<br>---<br>M res/res_rtp_asterisk.c<br>1 file changed, 13 insertions(+), 1 deletion(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/93/10993/1</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 9e603f2..3a4dfbe 100644</span><br><span>--- a/res/res_rtp_asterisk.c</span><br><span>+++ b/res/res_rtp_asterisk.c</span><br><span>@@ -5286,14 +5286,18 @@</span><br><span> unsigned int lsr_a;</span><br><span> unsigned int rtt;</span><br><span> double normdevrtt_current;</span><br><span style="color: hsl(120, 100%, 40%);">+ double tmp_double;</span><br><span style="color: hsl(120, 100%, 40%);">+ double dlsr_frac;</span><br><span style="color: hsl(120, 100%, 40%);">+ unsigned int dlsr_sec;</span><br><span> </span><br><span> gettimeofday(&now, NULL);</span><br><span> timeval2ntp(now, &msw, &lsw);</span><br><span> </span><br><span> lsr_a = ((msw & 0x0000ffff) << 16) | ((lsw & 0xffff0000) >> 16);</span><br><span style="color: hsl(0, 100%, 40%);">- rtt = lsr_a - lsr - dlsr;</span><br><span style="color: hsl(120, 100%, 40%);">+ rtt = lsr_a - lsr;</span><br><span> rtt_msw = (rtt & 0xffff0000) >> 16;</span><br><span> rtt_lsw = (rtt & 0x0000ffff);</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span> rtt_tv.tv_sec = rtt_msw;</span><br><span> /*</span><br><span> * Convert 16.16 fixed point rtt_lsw to usec without</span><br><span>@@ -5309,6 +5313,14 @@</span><br><span> * component in rtt_lsw.</span><br><span> */</span><br><span> rtt_tv.tv_usec = (rtt_lsw * 15625) >> 10;</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ tmp_double = dlsr / 65536;</span><br><span style="color: hsl(120, 100%, 40%);">+ dlsr_sec = tmp_double;</span><br><span style="color: hsl(120, 100%, 40%);">+ dlsr_frac = tmp_double - dlsr_sec;</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ rtt_tv.tv_sec -= dlsr_sec;</span><br><span style="color: hsl(120, 100%, 40%);">+ rtt_tv.tv_usec -= dlsr_frac * 1000000;</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span> rtp->rtcp->rtt = (double)rtt_tv.tv_sec + ((double)rtt_tv.tv_usec / 1000000);</span><br><span> if (lsr_a - dlsr < lsr) {</span><br><span> return 1;</span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.asterisk.org/10993">change 10993</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/10993"/><meta itemprop="name" content="View Change"/></div></div>
<div style="display:none"> Gerrit-Project: asterisk </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-MessageType: newchange </div>
<div style="display:none"> Gerrit-Change-Id: Id48b8ba1aba7c08b836ee526bf2619243379015f </div>
<div style="display:none"> Gerrit-Change-Number: 10993 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: sungtae kim <pchero21@gmail.com> </div>