aboutsummaryrefslogtreecommitdiffstats
path: root/codecs/codec_ilbc.c
diff options
context:
space:
mode:
authormarkster <markster@f38db490-d61c-443f-a65b-d21fe96a405b>2005-03-17 21:30:19 +0000
committermarkster <markster@f38db490-d61c-443f-a65b-d21fe96a405b>2005-03-17 21:30:19 +0000
commit235a6486c3ca01b9bdac577774cc90fa4f06a58f (patch)
tree2ff53ca559c15101655e44ad4281225c8aae6685 /codecs/codec_ilbc.c
parent98aa637d27b5ac36a35fc85b596f00d1104398e3 (diff)
Add PLC and jitter buffer and iax2 meta trunk with timestamps (bug #2532, #3400)
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@5192 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'codecs/codec_ilbc.c')
-rwxr-xr-xcodecs/codec_ilbc.c14
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;