aboutsummaryrefslogtreecommitdiffstats
path: root/codecs
diff options
context:
space:
mode:
authormarkster <markster@f38db490-d61c-443f-a65b-d21fe96a405b>2003-04-17 14:51:49 +0000
committermarkster <markster@f38db490-d61c-443f-a65b-d21fe96a405b>2003-04-17 14:51:49 +0000
commit909206f3c32585eb413df998de8ca69bcf8d4978 (patch)
tree84918802e4e0346fdd7e2099229719443a4e4768 /codecs
parent1accaa0293fa051c42260a68acd783c83a7a8ac8 (diff)
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
Diffstat (limited to 'codecs')
-rwxr-xr-xcodecs/codec_ilbc.c12
1 files changed, 6 insertions, 6 deletions
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;x<f->datalen;x+=52) {
+ for (x=0;x<f->datalen;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
{