<p> Attention is currently required from: Sean Bright. </p>
<p>George Joseph <strong>uploaded patch set #2</strong> to this change.</p><p><a href="https://gerrit.asterisk.org/c/asterisk/+/16073">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">jitterbuffer: Correct signed/unsigned mismatch causing assert<br><br>If the system time steps backwards because of a time adjustment<br>between the time a frame is timestamped and the time we check the<br>timestamps in abstract_jb:hook_event_cb(), we get a negative<br>interval, but we don't check for that there.<br>abstract_jb:hook_event_cb() then calls fixedjitterbuffer:fixed_jb_get<br>() (via abstract_jb:jb_get_fixed) and the first thing that does is<br>assert(interval >= 0).<br><br>There are several issues with this...<br><br> * abstract_jb:hook_event_cb() saves the interval in a variable<br> named "now" which is confusing in itself.<br><br> * "now" is defined as an unsigned int which converts the negative<br> value returned from ast_tvdiff_ms() to a large positive value.<br><br> * fixed_jb_get()'s parameter is defined as a signed int so the<br> interval gets converted back to a negative value.<br><br> * fixed_jb_get()'s assert is NOT an ast_assert but a direct define<br> that points to the system assert() so it triggers even in<br> production mode.<br><br>So...<br><br> * hook_event_cb()'s "now" was renamed to "relative_frame_start" and<br> changed to an int64_t.<br> * hook_event_cb() now checks for a negative value right after<br> retrieving both the current and framedata timestamps and just<br> returns the frame if the difference is negative.<br> * fixed_jb_get()'s local define of ASSERT() was changed to call<br> ast_assert() instead of the system assert().<br><br>ASTERISK-29480<br>Reported by: Dan Cropp<br><br>Change-Id: Ic469dec73c2edc3ba134cda6721a999a9714f3c9<br>---<br>M main/abstract_jb.c<br>M main/fixedjitterbuf.c<br>2 files changed, 19 insertions(+), 9 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/73/16073/2</pre><p>To view, visit <a href="https://gerrit.asterisk.org/c/asterisk/+/16073">change 16073</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/+/16073"/><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: Ic469dec73c2edc3ba134cda6721a999a9714f3c9 </div>
<div style="display:none"> Gerrit-Change-Number: 16073 </div>
<div style="display:none"> Gerrit-PatchSet: 2 </div>
<div style="display:none"> Gerrit-Owner: George Joseph <gjoseph@digium.com> </div>
<div style="display:none"> Gerrit-Reviewer: Friendly Automation </div>
<div style="display:none"> Gerrit-CC: Sean Bright <sean@seanbright.com> </div>
<div style="display:none"> Gerrit-Attention: Sean Bright <sean@seanbright.com> </div>
<div style="display:none"> Gerrit-MessageType: newpatchset </div>