<p>George Joseph <strong>merged</strong> this change.</p><p><a href="https://gerrit.asterisk.org/10436">View Change</a></p><div style="white-space:pre-wrap">Approvals:
Corey Farrell: Looks good to me, but someone else must approve
Benjamin Keith Ford: Looks good to me, but someone else must approve
George Joseph: Looks good to me, approved; Approved for Submit
</div><pre style="font-family: monospace,monospace; white-space: pre-wrap;">codec_speex.c: Cleanup module loading to DECLINE and not FAILURE.<br><br>If codec_speex fails to register a translator it would cause Asterisk to<br>exit instead of continue as a DECLINED module.<br><br>* Make unload_module() always return 0. It is silly to fail unloading if<br>any translators we try to unregister were not even registered.<br><br>Change-Id: Ia262591f68333dad17673ba7104d11c88096f51a<br>---<br>M codecs/codec_speex.c<br>1 file changed, 12 insertions(+), 14 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/codecs/codec_speex.c b/codecs/codec_speex.c</span><br><span>index 591fce9..0354bd5 100644</span><br><span>--- a/codecs/codec_speex.c</span><br><span>+++ b/codecs/codec_speex.c</span><br><span>@@ -689,39 +689,37 @@</span><br><span> </span><br><span> static int unload_module(void)</span><br><span> {</span><br><span style="color: hsl(0, 100%, 40%);">- int res = 0;</span><br><span style="color: hsl(120, 100%, 40%);">+ ast_unregister_translator(&speextolin);</span><br><span style="color: hsl(120, 100%, 40%);">+ ast_unregister_translator(&lintospeex);</span><br><span style="color: hsl(120, 100%, 40%);">+ ast_unregister_translator(&speexwbtolin16);</span><br><span style="color: hsl(120, 100%, 40%);">+ ast_unregister_translator(&lin16tospeexwb);</span><br><span style="color: hsl(120, 100%, 40%);">+ ast_unregister_translator(&speexuwbtolin32);</span><br><span style="color: hsl(120, 100%, 40%);">+ ast_unregister_translator(&lin32tospeexuwb);</span><br><span> </span><br><span style="color: hsl(0, 100%, 40%);">- res |= ast_unregister_translator(&speextolin);</span><br><span style="color: hsl(0, 100%, 40%);">- res |= ast_unregister_translator(&lintospeex);</span><br><span style="color: hsl(0, 100%, 40%);">- res |= ast_unregister_translator(&speexwbtolin16);</span><br><span style="color: hsl(0, 100%, 40%);">- res |= ast_unregister_translator(&lin16tospeexwb);</span><br><span style="color: hsl(0, 100%, 40%);">- res |= ast_unregister_translator(&speexuwbtolin32);</span><br><span style="color: hsl(0, 100%, 40%);">- res |= ast_unregister_translator(&lin32tospeexuwb);</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">- return res;</span><br><span style="color: hsl(120, 100%, 40%);">+ return 0;</span><br><span> }</span><br><span> </span><br><span> static int load_module(void)</span><br><span> {</span><br><span> int res = 0;</span><br><span> </span><br><span style="color: hsl(0, 100%, 40%);">- if (parse_config(0))</span><br><span style="color: hsl(120, 100%, 40%);">+ if (parse_config(0)) {</span><br><span> return AST_MODULE_LOAD_DECLINE;</span><br><span style="color: hsl(120, 100%, 40%);">+ }</span><br><span> </span><br><span style="color: hsl(120, 100%, 40%);">+ /* XXX It is most likely a bug in this module if we fail to register a translator */</span><br><span> res |= ast_register_translator(&speextolin);</span><br><span> res |= ast_register_translator(&lintospeex);</span><br><span> res |= ast_register_translator(&speexwbtolin16);</span><br><span> res |= ast_register_translator(&lin16tospeexwb);</span><br><span> res |= ast_register_translator(&speexuwbtolin32);</span><br><span> res |= ast_register_translator(&lin32tospeexuwb);</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span> if (res) {</span><br><span> unload_module();</span><br><span style="color: hsl(0, 100%, 40%);">- return res;</span><br><span style="color: hsl(120, 100%, 40%);">+ return AST_MODULE_LOAD_DECLINE;</span><br><span> }</span><br><span> </span><br><span style="color: hsl(0, 100%, 40%);">- return res;</span><br><span style="color: hsl(120, 100%, 40%);">+ return AST_MODULE_LOAD_SUCCESS;</span><br><span> }</span><br><span> </span><br><span> AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODFLAG_DEFAULT, "Speex Coder/Decoder",</span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.asterisk.org/10436">change 10436</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/10436"/><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: merged </div>
<div style="display:none"> Gerrit-Change-Id: Ia262591f68333dad17673ba7104d11c88096f51a </div>
<div style="display:none"> Gerrit-Change-Number: 10436 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: Richard Mudgett <rmudgett@digium.com> </div>
<div style="display:none"> Gerrit-Reviewer: Benjamin Keith Ford <bford@digium.com> </div>
<div style="display:none"> Gerrit-Reviewer: Corey Farrell <git@cfware.com> </div>
<div style="display:none"> Gerrit-Reviewer: George Joseph <gjoseph@digium.com> </div>
<div style="display:none"> Gerrit-Reviewer: Jenkins2 (1000185) </div>