aboutsummaryrefslogtreecommitdiffstats
path: root/codecs/codec_a_mu.c
diff options
context:
space:
mode:
authorrussell <russell@f38db490-d61c-443f-a65b-d21fe96a405b>2006-05-23 22:57:03 +0000
committerrussell <russell@f38db490-d61c-443f-a65b-d21fe96a405b>2006-05-23 22:57:03 +0000
commitfba1ee583a3e223b892fe08500010b919d8c27fe (patch)
treefb617ec24d712619b0a3b4a3bed80027ed473e39 /codecs/codec_a_mu.c
parentd24bbad05e440bccb2607cef6a726e749571638d (diff)
further codec module optimization based on codec_alaw changes by rizzo
(issue #7190, Mithraen) git-svn-id: http://svn.digium.com/svn/asterisk/trunk@29880 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'codecs/codec_a_mu.c')
-rw-r--r--codecs/codec_a_mu.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/codecs/codec_a_mu.c b/codecs/codec_a_mu.c
index f1b35299a..05dbe5c73 100644
--- a/codecs/codec_a_mu.c
+++ b/codecs/codec_a_mu.c
@@ -56,14 +56,15 @@ static unsigned char a2mu[256];
static int alawtoulaw_framein(struct ast_trans_pvt *pvt, struct ast_frame *f)
{
int x = f->samples;
- int in_samples = f->samples;
unsigned char *src = f->data;
unsigned char *dst = (unsigned char *)pvt->outbuf + pvt->samples;
+ pvt->samples += x;
+ pvt->datalen += x;
+
while (x--)
*dst++ = a2mu[*src++];
- pvt->samples += in_samples;
- pvt->datalen += in_samples;
+
return 0;
}
@@ -71,14 +72,15 @@ static int alawtoulaw_framein(struct ast_trans_pvt *pvt, struct ast_frame *f)
static int ulawtoalaw_framein(struct ast_trans_pvt *pvt, struct ast_frame *f)
{
int x = f->samples;
- int in_samples = f->samples;
unsigned char *src = f->data;
unsigned char *dst = (unsigned char *)pvt->outbuf + pvt->samples;
+ pvt->samples += x;
+ pvt->datalen += x;
+
while (x--)
*dst++ = mu2a[*src++];
- pvt->samples += in_samples;
- pvt->datalen += in_samples;
+
return 0;
}