<p> Attention is currently required from: N A. </p>
<p>Patch set 1:<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/+/15953">View Change</a></p><p>3 comments:</p><ul style="list-style: none; padding: 0;"><li style="margin: 0; padding: 0;"><p><a href="null">File include/asterisk/translate.h:</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/+/15953/comment/75c37abe_517f7676">Patch Set #1, Line 285:</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;">/*! \brief Determine which protocol is higher quality<br> *<br> * Given two codec identifiers, is the first codec strictly superior to the second?<br> *<br> * \param codec identifier A<br> * \param codec identifier B<br> * \return Returns 1 if codec A is positively superior to B, 0 otherwise.<br> */<br>int ast_translator_better_quality(int c1, int c2);<br></pre></blockquote></p><p style="white-space: pre-wrap; word-wrap: break-word;">Since this function deals with choosing the best codec supplied by given formats I'd move this function to format.c/h or maybe format_compatibility.c/h? Although the latter has historically been for bitfield checks.</p></li><li style="margin: 0; padding: 0 0 0 16px;"><p style="margin-bottom: 4px;"><a href="https://gerrit.asterisk.org/c/asterisk/+/15953/comment/de21a673_7bffa56c">Patch Set #1, Line 293:</a> <code style="font-family:monospace,monospace">int ast_translator_better_quality(int c1, int c2);</code></p><p style="white-space: pre-wrap; word-wrap: break-word;">I'd pass in a pointer to the formats themselves, and then retrieve c1 & c2 within. Doing so makes it more obvious formats and codecs are being checked. Also makes it less likely an arbitrary value gets passed in.</p></li></ul></li><li style="margin: 0; padding: 0;"><p><a href="null">File main/translate.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/+/15953/comment/e49352ac_64de1143">Patch Set #1, Line 1499:</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;">                               } else if (gap_current == gap_selected) {<br>                                     if (ast_translator_better_quality(<br>                                            ast_format_get_codec_id(src), ast_format_get_codec_id(best))) {<br></pre></blockquote></p><p style="white-space: pre-wrap; word-wrap: break-word;">I think if you wanted you could combine this with the above to reduce some code duplication?</p><p style="white-space: pre-wrap; word-wrap: break-word;">if (gap_current < gap_selected || ((gap_current == gap_selected && ast_translator_better_quality(src, best))) { ....</p></li></ul></li></ul><p>To view, visit <a href="https://gerrit.asterisk.org/c/asterisk/+/15953">change 15953</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/+/15953"/><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-Change-Id: I4b7297e1baca7aac14fe4a3c7538e18e2dbe9fd6 </div>
<div style="display:none"> Gerrit-Change-Number: 15953 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: N A <mail@interlinked.x10host.com> </div>
<div style="display:none"> Gerrit-Reviewer: Friendly Automation </div>
<div style="display:none"> Gerrit-Reviewer: Kevin Harwell <kharwell@digium.com> </div>
<div style="display:none"> Gerrit-Attention: N A <mail@interlinked.x10host.com> </div>
<div style="display:none"> Gerrit-Comment-Date: Tue, 01 Jun 2021 20:47:13 +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>