[asterisk-commits] trunk r29129 - /trunk/codecs/codec_alaw.c

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Sun May 21 02:56:38 MST 2006


Author: rizzo
Date: Sun May 21 04:56:38 2006
New Revision: 29129

URL: http://svn.digium.com/view/asterisk?rev=29129&view=rev
Log:
remove an unused variable, and while at it
add some very minor optimizations.


Modified:
    trunk/codecs/codec_alaw.c

Modified: trunk/codecs/codec_alaw.c
URL: http://svn.digium.com/view/asterisk/trunk/codecs/codec_alaw.c?rev=29129&r1=29128&r2=29129&view=diff
==============================================================================
--- trunk/codecs/codec_alaw.c (original)
+++ trunk/codecs/codec_alaw.c Sun May 21 04:56:38 2006
@@ -57,13 +57,13 @@
 	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 @@
 	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;
 }
 



More information about the asterisk-commits mailing list