remove an unused variable, and while at it
authorLuigi Rizzo <rizzo@icir.org>
Sun, 21 May 2006 09:56:38 +0000 (09:56 +0000)
committerLuigi Rizzo <rizzo@icir.org>
Sun, 21 May 2006 09:56:38 +0000 (09:56 +0000)
add some very minor optimizations.

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@29129 65c4cc65-6c06-0410-ace0-fbb531ad65f3

codecs/codec_alaw.c

index 1e99ac9..f0e0667 100644 (file)
@@ -57,13 +57,13 @@ static int alawtolin_framein(struct ast_trans_pvt *pvt, struct ast_frame *f)
        int i = f->samples;
        unsigned char *src = f->data;
        int16_t *dst = (int16_t *)pvt->outbuf + pvt->samples;
-       int in_samples = f->samples;
+
+       pvt->samples += i;
+       pvt->datalen += i * 2;  /* 2 bytes/sample */
        
        while (i--)
                *dst++ = AST_ALAW(*src++);
 
-       pvt->samples += f->samples;
-       pvt->datalen += f->samples * 2; /* 2 bytes/sample */
        return 0;
 }
 
@@ -73,13 +73,13 @@ static int lintoalaw_framein(struct ast_trans_pvt *pvt, struct ast_frame *f)
        int i = f->samples;
        char *dst = pvt->outbuf + pvt->samples;
        int16_t *src = f->data;
-       int in_samples = f->samples;
+
+       pvt->samples += i;
+       pvt->datalen += i;      /* 1 byte/sample */
 
        while (i--) 
                *dst++ = AST_LIN2A(*src++);
 
-       pvt->samples += in_samples;
-       pvt->datalen += in_samples;     /* 1 byte/sample */
        return 0;
 }