<div dir="ltr"><br><div class="gmail_extra"><div class="gmail_quote">On Fri, Jul 12, 2013 at 9:04 AM, Paul Albrecht <span dir="ltr"><<a href="mailto:palbrecht@glccom.com" target="_blank">palbrecht@glccom.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">Hi,<br>
<br>
Think I found the reason the mp3 application sends short frames. Here's the relevant code:<br>
<br>
static int timed_read(int fd, void *data, int datalen, int timeout)<br>
{<br>
int res;<br>
struct pollfd fds[1];<br>
fds[0].fd = fd;<br>
fds[0].events = POLLIN;<br>
res = ast_poll(fds, 1, timeout);<br>
if (res < 1) {<br>
ast_log(LOG_NOTICE, "Poll timed out/errored out with %d\n", res);<br>
return -1;<br>
}<br>
return read(fd, data, datalen);<br>
<br>
}<br>
<br></blockquote><div><br></div><div style>I'm not sure I would fix it there. The loop in mp3_exec is what is calling timed_read and constructs the audio frame from the read data - it should probably check the number of bytes read and, if it isn't enough for a full frame, buffer the data and call read again.</div>
<div style><br></div><div style>So yes, "bug".</div><div style><br></div><div style>On the other hand, app_mp3 is an extended support module, so any development effort for it comes from the Asterisk developer community. A patch fixing the behavior would be appreciated.</div>
<div style><br></div><div style>Matt</div></div><div><br></div>-- <br><div dir="ltr"><div>Matthew Jordan<br></div><div>Digium, Inc. | Engineering Manager</div><div>445 Jan Davis Drive NW - Huntsville, AL 35806 - USA</div>
<div>Check us out at: <a href="http://digium.com" target="_blank">http://digium.com</a> & <a href="http://asterisk.org" target="_blank">http://asterisk.org</a></div></div>
</div></div>