Add PLC and jitter buffer and iax2 meta trunk with timestamps (bug #2532, #3400)

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@5192 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
Mark Spencer
2005-03-17 21:30:19 +00:00
parent 6546acebfb
commit 7082d0584e
22 changed files with 1952 additions and 46 deletions

View File

@@ -141,7 +141,19 @@ static int ilbctolin_framein(struct ast_translator_pvt *tmp, struct ast_frame *f
the tail location. Read in as many frames as there are */
int x,i;
float tmpf[240];
if (f->datalen == 0) { /* native PLC */
if (tmp->tail + 240 < sizeof(tmp->buf)/2) {
iLBC_decode(tmpf, NULL, &tmp->dec, 0);
for (i=0;i<240;i++)
tmp->buf[tmp->tail + i] = tmpf[i];
tmp->tail+=240;
} else {
ast_log(LOG_WARNING, "Out of buffer space\n");
return -1;
}
}
if (f->datalen % 50) {
ast_log(LOG_WARNING, "Huh? An ilbc frame that isn't a multiple of 50 bytes long from %s (%d)?\n", f->src, f->datalen);
return -1;