diff options
author | Mark Spencer <markster@digium.com> | 2005-03-17 21:30:19 +0000 |
---|---|---|
committer | Mark Spencer <markster@digium.com> | 2005-03-17 21:30:19 +0000 |
commit | 7082d0584eb61abbc7c8055b74d9a7955046a8ef (patch) | |
tree | 2ff53ca559c15101655e44ad4281225c8aae6685 /codecs/codec_ilbc.c | |
parent | 6546acebfb807eed42c78e737eb2de158b0f26c0 (diff) |
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
Diffstat (limited to 'codecs/codec_ilbc.c')
-rwxr-xr-x | codecs/codec_ilbc.c | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/codecs/codec_ilbc.c b/codecs/codec_ilbc.c index 4bbb28c49..1c7428e8f 100755 --- a/codecs/codec_ilbc.c +++ b/codecs/codec_ilbc.c @@ -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; |