<p>Friendly Automation <strong>submitted</strong> this change.</p><p><a href="https://gerrit.asterisk.org/c/asterisk/+/16503">View Change</a></p><div style="white-space:pre-wrap">Approvals:
Kevin Harwell: Looks good to me, but someone else must approve
George Joseph: Looks good to me, approved
Friendly Automation: Approved for Submit
</div><pre style="font-family: monospace,monospace; white-space: pre-wrap;">app_mp3: Force output to 16 bits in mpg123<br><br>In new mpg123 versions (since 1.26) the default output is 32 bits<br>Asterisk expects the output in 16 bits, so we force the output to be on 16 bits.<br>It will work wit new and old versions of mpg123.<br>Thanks Thomas Orgis <thomas-forum@orgis.org> for giving the key!<br><br>ASTERISK-29635 #close<br><br>Change-Id: I88c7740118b5af4e895bd8b765b68ed5c11fc816<br>---<br>M apps/app_mp3.c<br>1 file changed, 12 insertions(+), 12 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/apps/app_mp3.c b/apps/app_mp3.c</span><br><span>index 8d049da..8422240 100644</span><br><span>--- a/apps/app_mp3.c</span><br><span>+++ b/apps/app_mp3.c</span><br><span>@@ -100,37 +100,37 @@</span><br><span> char buffer_size_str[8];</span><br><span> snprintf(buffer_size_str, 8, "%u", (int) 0.5*2*sampling_rate/1000); // 0.5 seconds for a live stream</span><br><span> /* Most commonly installed in /usr/local/bin */</span><br><span style="color: hsl(0, 100%, 40%);">- execl(LOCAL_MPG_123, "mpg123", "-q", "-s", "-b", buffer_size_str, "-f", "8192", "--mono", "-r", sampling_rate_str, "-@", filename, (char *)NULL);</span><br><span style="color: hsl(120, 100%, 40%);">+ execl(LOCAL_MPG_123, "mpg123", "-e", "s16", "-q", "-s", "-b", buffer_size_str, "-f", "8192", "--mono", "-r", sampling_rate_str, "-@", filename, (char *)NULL);</span><br><span> /* But many places has it in /usr/bin */</span><br><span style="color: hsl(0, 100%, 40%);">- execl(MPG_123, "mpg123", "-q", "-s", "-b", buffer_size_str, "-f", "8192", "--mono", "-r", sampling_rate_str, "-@", filename, (char *)NULL);</span><br><span style="color: hsl(120, 100%, 40%);">+ execl(MPG_123, "mpg123", "-e", "s16", "-q", "-s", "-b", buffer_size_str, "-f", "8192", "--mono", "-r", sampling_rate_str, "-@", filename, (char *)NULL);</span><br><span> /* As a last-ditch effort, try to use PATH */</span><br><span style="color: hsl(0, 100%, 40%);">- execlp("mpg123", "mpg123", "-q", "-s", "-b", buffer_size_str, "-f", "8192", "--mono", "-r", sampling_rate_str, "-@", filename, (char *)NULL);</span><br><span style="color: hsl(120, 100%, 40%);">+ execlp("mpg123", "mpg123", "-e", "s16", "-q", "-s", "-b", buffer_size_str, "-f", "8192", "--mono", "-r", sampling_rate_str, "-@", filename, (char *)NULL);</span><br><span> }</span><br><span> else if (!strncasecmp(filename, "http://", 7)) {</span><br><span> char buffer_size_str[8];</span><br><span> snprintf(buffer_size_str, 8, "%u", 6*2*sampling_rate/1000); // 6 seconds for a remote MP3 file</span><br><span> /* Most commonly installed in /usr/local/bin */</span><br><span style="color: hsl(0, 100%, 40%);">- execl(LOCAL_MPG_123, "mpg123", "-q", "-s", "-b", buffer_size_str, "-f", "8192", "--mono", "-r", sampling_rate_str, filename, (char *)NULL);</span><br><span style="color: hsl(120, 100%, 40%);">+ execl(LOCAL_MPG_123, "mpg123", "-e", "s16", "-q", "-s", "-b", buffer_size_str, "-f", "8192", "--mono", "-r", sampling_rate_str, filename, (char *)NULL);</span><br><span> /* But many places has it in /usr/bin */</span><br><span style="color: hsl(0, 100%, 40%);">- execl(MPG_123, "mpg123", "-q", "-s", "-b", buffer_size_str, "-f", "8192", "--mono", "-r", sampling_rate_str, filename, (char *)NULL);</span><br><span style="color: hsl(120, 100%, 40%);">+ execl(MPG_123, "mpg123", "-e", "s16", "-q", "-s", "-b", buffer_size_str, "-f", "8192", "--mono", "-r", sampling_rate_str, filename, (char *)NULL);</span><br><span> /* As a last-ditch effort, try to use PATH */</span><br><span style="color: hsl(0, 100%, 40%);">- execlp("mpg123", "mpg123", "-q", "-s", "-b", buffer_size_str, "-f", "8192", "--mono", "-r", sampling_rate_str, filename, (char *)NULL);</span><br><span style="color: hsl(120, 100%, 40%);">+ execlp("mpg123", "mpg123", "-e", "s16", "-q", "-s", "-b", buffer_size_str, "-f", "8192", "--mono", "-r", sampling_rate_str, filename, (char *)NULL);</span><br><span> }</span><br><span> else if (strstr(filename, ".m3u")) {</span><br><span> /* Most commonly installed in /usr/local/bin */</span><br><span style="color: hsl(0, 100%, 40%);">- execl(LOCAL_MPG_123, "mpg123", "-q", "-z", "-s", "-f", "8192", "--mono", "-r", sampling_rate_str, "-@", filename, (char *)NULL);</span><br><span style="color: hsl(120, 100%, 40%);">+ execl(LOCAL_MPG_123, "mpg123", "-e", "s16", "-q", "-z", "-s", "-f", "8192", "--mono", "-r", sampling_rate_str, "-@", filename, (char *)NULL);</span><br><span> /* But many places has it in /usr/bin */</span><br><span style="color: hsl(0, 100%, 40%);">- execl(MPG_123, "mpg123", "-q", "-z", "-s", "-f", "8192", "--mono", "-r", sampling_rate_str, "-@", filename, (char *)NULL);</span><br><span style="color: hsl(120, 100%, 40%);">+ execl(MPG_123, "mpg123", "-e", "s16", "-q", "-z", "-s", "-f", "8192", "--mono", "-r", sampling_rate_str, "-@", filename, (char *)NULL);</span><br><span> /* As a last-ditch effort, try to use PATH */</span><br><span style="color: hsl(0, 100%, 40%);">- execlp("mpg123", "mpg123", "-q", "-z", "-s", "-f", "8192", "--mono", "-r", sampling_rate_str, "-@", filename, (char *)NULL);</span><br><span style="color: hsl(120, 100%, 40%);">+ execlp("mpg123", "mpg123", "-e", "s16", "-q", "-z", "-s", "-f", "8192", "--mono", "-r", sampling_rate_str, "-@", filename, (char *)NULL);</span><br><span> }</span><br><span> else {</span><br><span> /* Most commonly installed in /usr/local/bin */</span><br><span style="color: hsl(0, 100%, 40%);">- execl(MPG_123, "mpg123", "-q", "-s", "-f", "8192", "--mono", "-r", sampling_rate_str, filename, (char *)NULL);</span><br><span style="color: hsl(120, 100%, 40%);">+ execl(MPG_123, "mpg123", "-e", "s16", "-q", "-s", "-f", "8192", "--mono", "-r", sampling_rate_str, filename, (char *)NULL);</span><br><span> /* But many places has it in /usr/bin */</span><br><span style="color: hsl(0, 100%, 40%);">- execl(LOCAL_MPG_123, "mpg123", "-q", "-s", "-f", "8192", "--mono", "-r", sampling_rate_str, filename, (char *)NULL);</span><br><span style="color: hsl(120, 100%, 40%);">+ execl(LOCAL_MPG_123, "mpg123", "-e", "s16", "-q", "-s", "-f", "8192", "--mono", "-r", sampling_rate_str, filename, (char *)NULL);</span><br><span> /* As a last-ditch effort, try to use PATH */</span><br><span style="color: hsl(0, 100%, 40%);">- execlp("mpg123", "mpg123", "-q", "-s", "-f", "8192", "--mono", "-r", sampling_rate_str, filename, (char *)NULL);</span><br><span style="color: hsl(120, 100%, 40%);">+ execlp("mpg123", "mpg123", "-e", "s16", "-q", "-s", "-f", "8192", "--mono", "-r", sampling_rate_str, filename, (char *)NULL);</span><br><span> }</span><br><span> /* Can't use ast_log since FD's are closed */</span><br><span> fprintf(stderr, "Execute of mpg123 failed\n");</span><br><span></span><br></pre><div style="white-space:pre-wrap"></div><p>To view, visit <a href="https://gerrit.asterisk.org/c/asterisk/+/16503">change 16503</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/+/16503"/><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: I88c7740118b5af4e895bd8b765b68ed5c11fc816 </div>
<div style="display:none"> Gerrit-Change-Number: 16503 </div>
<div style="display:none"> Gerrit-PatchSet: 2 </div>
<div style="display:none"> Gerrit-Owner: Carlos Oliva <carlos.oliva@invoxcontact.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: Kevin Harwell <kharwell@digium.com> </div>
<div style="display:none"> Gerrit-MessageType: merged </div>