<p>Friendly Automation <strong>submitted</strong> this change.</p><p><a href="https://gerrit.asterisk.org/c/asterisk/+/13654">View Change</a></p><div style="white-space:pre-wrap">Approvals:
George Joseph: Looks good to me, but someone else must approve
Benjamin Keith Ford: Looks good to me, but someone else must approve
Joshua Colp: Looks good to me, approved
Friendly Automation: Approved for Submit
</div><pre style="font-family: monospace,monospace; white-space: pre-wrap;">translate.c: Fix silk 24kHz truncation in 'core show translation'<br><br>SILK @ 24kHz is not shown in the 'core show translation' output because of an<br>off-by-one-error. Discovered while looking into ASTERISK~19871.<br><br>ASTERISK-28706<br>Reported by: Sean Bright<br><br>Change-Id: Ie1a551a8a484e07b45c8699cc0c90f1061029510<br>---<br>M main/translate.c<br>1 file changed, 4 insertions(+), 4 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/main/translate.c b/main/translate.c</span><br><span>index 5542107..6648931 100644</span><br><span>--- a/main/translate.c</span><br><span>+++ b/main/translate.c</span><br><span>@@ -983,14 +983,14 @@</span><br><span> {</span><br><span> int x, y, i, k;</span><br><span> int longest = 7; /* slin192 */</span><br><span style="color: hsl(0, 100%, 40%);">- int num_codecs = 0, curlen = 0;</span><br><span style="color: hsl(120, 100%, 40%);">+ int max_codec_index = 0, curlen = 0;</span><br><span> struct ast_str *out = ast_str_create(1024);</span><br><span> struct ast_codec *codec;</span><br><span> </span><br><span> /* Get the length of the longest (usable?) codec name,</span><br><span> so we know how wide the left side should be */</span><br><span> for (i = 1; (codec = ast_codec_get_by_id(i)); ao2_ref(codec, -1), ++i) {</span><br><span style="color: hsl(0, 100%, 40%);">- ++num_codecs;</span><br><span style="color: hsl(120, 100%, 40%);">+ ++max_codec_index;</span><br><span> if (codec->type != AST_MEDIA_TYPE_AUDIO) {</span><br><span> continue;</span><br><span> }</span><br><span>@@ -1004,7 +1004,7 @@</span><br><span> ast_cli(a->fd, " Translation times between formats (in microseconds) for one second of data\n");</span><br><span> ast_cli(a->fd, " Source Format (Rows) Destination Format (Columns)\n\n");</span><br><span> </span><br><span style="color: hsl(0, 100%, 40%);">- for (i = 0; i < num_codecs; i++) {</span><br><span style="color: hsl(120, 100%, 40%);">+ for (i = 0; i <= max_codec_index; i++) {</span><br><span> struct ast_codec *row = i ? ast_codec_get_by_id(i) : NULL;</span><br><span> </span><br><span> x = -1;</span><br><span>@@ -1019,7 +1019,7 @@</span><br><span> }</span><br><span> </span><br><span> ast_str_set(&out, 0, " ");</span><br><span style="color: hsl(0, 100%, 40%);">- for (k = 0; k < num_codecs; k++) {</span><br><span style="color: hsl(120, 100%, 40%);">+ for (k = 0; k <= max_codec_index; k++) {</span><br><span> int adjust = 0;</span><br><span> struct ast_codec *col = k ? ast_codec_get_by_id(k) : NULL;</span><br><span> </span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.asterisk.org/c/asterisk/+/13654">change 13654</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/+/13654"/><meta itemprop="name" content="View Change"/></div></div>
<div style="display:none"> Gerrit-Project: asterisk </div>
<div style="display:none"> Gerrit-Branch: 17 </div>
<div style="display:none"> Gerrit-Change-Id: Ie1a551a8a484e07b45c8699cc0c90f1061029510 </div>
<div style="display:none"> Gerrit-Change-Number: 13654 </div>
<div style="display:none"> Gerrit-PatchSet: 3 </div>
<div style="display:none"> Gerrit-Owner: Sean Bright <sean.bright@gmail.com> </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>