From 909206f3c32585eb413df998de8ca69bcf8d4978 Mon Sep 17 00:00:00 2001 From: markster Date: Thu, 17 Apr 2003 14:51:49 +0000 Subject: Use 50 bytes instead of 52 bytes on ilbc git-svn-id: http://svn.digium.com/svn/asterisk/trunk@862 f38db490-d61c-443f-a65b-d21fe96a405b --- codecs/codec_ilbc.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'codecs') diff --git a/codecs/codec_ilbc.c b/codecs/codec_ilbc.c index c5e67f881..014151b87 100755 --- a/codecs/codec_ilbc.c +++ b/codecs/codec_ilbc.c @@ -137,12 +137,12 @@ static int ilbctolin_framein(struct ast_translator_pvt *tmp, struct ast_frame *f int x,i; float tmpf[240]; - if (f->datalen % 52) { - ast_log(LOG_WARNING, "Huh? An ilbc frame that isn't a multiple of 52 bytes long from %s (%d)?\n", f->src, f->datalen); + 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; } - for (x=0;xdatalen;x+=52) { + for (x=0;xdatalen;x+=50) { if (tmp->tail + 240 < sizeof(tmp->buf)/2) { iLBC_decode(tmpf, f->data + x, &tmp->dec, 1); for (i=0;i<240;i++) @@ -186,14 +186,14 @@ static struct ast_frame *lintoilbc_frameout(struct ast_translator_pvt *tmp) tmp->f.src = __PRETTY_FUNCTION__; tmp->f.data = tmp->outbuf; while(tmp->tail >= 240) { - if ((x+1) * 52 >= sizeof(tmp->outbuf)) { + if ((x+1) * 50 >= sizeof(tmp->outbuf)) { ast_log(LOG_WARNING, "Out of buffer space\n"); break; } for (i=0;i<240;i++) tmpf[i] = tmp->buf[i]; /* Encode a frame of data */ - iLBC_encode(((unsigned char *)(tmp->outbuf)) + (x * 52), tmpf, &tmp->enc); + iLBC_encode(((unsigned char *)(tmp->outbuf)) + (x * 50), tmpf, &tmp->enc); /* Assume 8000 Hz -- 20 ms */ tmp->tail -= 240; /* Move the data at the end of the buffer to the front */ @@ -201,7 +201,7 @@ static struct ast_frame *lintoilbc_frameout(struct ast_translator_pvt *tmp) memmove(tmp->buf, tmp->buf + 240, tmp->tail * 2); x++; } - tmp->f.datalen = x * 52; + tmp->f.datalen = x * 50; tmp->f.samples = x * 240; #if 0 { -- cgit v1.2.3