<p>Patch set 2:<span style="border-radius: 3px; display: inline-block; margin: 0 2px; padding: 4px;background-color: #ffd4d4; color: #000000;">Code-Review -1</span></p><p><a href="https://gerrit.asterisk.org/c/asterisk/+/14503">View Change</a></p><p>2 comments:</p><ul style="list-style: none; padding: 0;"><li style="margin: 0; padding: 0;"><p><a href="https://gerrit.asterisk.org/c/asterisk/+/14503/2/main/bridge_channel.c">File main/bridge_channel.c:</a></p><ul style="list-style: none; padding: 0;"><li style="margin: 0; padding: 0 0 0 16px;"><p style="margin-bottom: 4px;"><a href="https://gerrit.asterisk.org/c/asterisk/+/14503/2/main/bridge_channel.c@1046">Patch Set #2, Line 1046:</a> </p><p><blockquote style="border-left: 1px solid #aaa; margin: 10px 0; padding: 0 10px;"><pre style="font-family: monospace,monospace; white-space: pre-wrap;">        if ((fr->frametype == AST_FRAME_VOICE || fr->frametype == AST_FRAME_VIDEO ||<br>            fr->frametype == AST_FRAME_TEXT || fr->frametype == AST_FRAME_IMAGE ||<br>          fr->frametype == AST_FRAME_RTCP) && fr->stream_num > -1) {<br>           int num = -1;<br><br>               ast_bridge_channel_lock(bridge_channel);<br>              if (fr->stream_num < (int)AST_VECTOR_SIZE(&bridge_channel->stream_map.to_channel)) {<br>                     num = AST_VECTOR_GET(&bridge_channel->stream_map.to_channel, fr->stream_num);<br>               }<br>             ast_bridge_channel_unlock(bridge_channel);<br><br>          if (num == -1) {<br>                      /* We don't have a mapped stream so just discard this frame. */<br>                   return 0;<br>             }<br>     }<br></pre></blockquote></p><p style="white-space: pre-wrap; word-wrap: break-word;">How about moving this below the lock on line 1868 that way we don't have to do lock/unlock, lock/unlock.</p></li><li style="margin: 0; padding: 0 0 0 16px;"><p style="margin-bottom: 4px;"><a href="https://gerrit.asterisk.org/c/asterisk/+/14503/2/main/bridge_channel.c@1063">Patch Set #2, Line 1063:</a> </p><p><blockquote style="border-left: 1px solid #aaa; margin: 10px 0; padding: 0 10px;"><pre style="font-family: monospace,monospace; white-space: pre-wrap;">   dup = ast_frdup(fr);<br>  if (!dup) {<br>           return -1;<br>    }<br><br></pre></blockquote></p><p style="white-space: pre-wrap; word-wrap: break-word;">Could move this down to just before the INSERT_TAIL as an additional optimization since we don't use it until then.  Saves having to allocate then free it in case we hit the "leaving" or "text" conditions.</p></li></ul></li></ul><p>To view, visit <a href="https://gerrit.asterisk.org/c/asterisk/+/14503">change 14503</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/+/14503"/><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: I17189b9b1dec45fc7e4490e8081d444a25a00bda </div>
<div style="display:none"> Gerrit-Change-Number: 14503 </div>
<div style="display:none"> Gerrit-PatchSet: 2 </div>
<div style="display:none"> Gerrit-Owner: Joshua Colp <jcolp@sangoma.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-Comment-Date: Fri, 05 Jun 2020 13:41:23 +0000 </div>
<div style="display:none"> Gerrit-HasComments: Yes </div>
<div style="display:none"> Gerrit-Has-Labels: Yes </div>
<div style="display:none"> Gerrit-MessageType: comment </div>