diff options
Diffstat (limited to 'codecs/codec_a_mu.c')
-rw-r--r-- | codecs/codec_a_mu.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/codecs/codec_a_mu.c b/codecs/codec_a_mu.c index 6ab79be61..f1b35299a 100644 --- a/codecs/codec_a_mu.c +++ b/codecs/codec_a_mu.c @@ -55,12 +55,12 @@ static unsigned char a2mu[256]; /*! \brief convert frame data and store into the buffer */ static int alawtoulaw_framein(struct ast_trans_pvt *pvt, struct ast_frame *f) { - int i; + int x = f->samples; int in_samples = f->samples; unsigned char *src = f->data; unsigned char *dst = (unsigned char *)pvt->outbuf + pvt->samples; - for (i = 0; i < in_samples; i++) + while (x--) *dst++ = a2mu[*src++]; pvt->samples += in_samples; pvt->datalen += in_samples; @@ -70,12 +70,12 @@ static int alawtoulaw_framein(struct ast_trans_pvt *pvt, struct ast_frame *f) /*! \brief convert frame data and store into the buffer */ static int ulawtoalaw_framein(struct ast_trans_pvt *pvt, struct ast_frame *f) { - int i; + int x = f->samples; int in_samples = f->samples; unsigned char *src = f->data; unsigned char *dst = (unsigned char *)pvt->outbuf + pvt->samples; - for (i = 0; i < in_samples; i++) + while (x--) *dst++ = mu2a[*src++]; pvt->samples += in_samples; pvt->datalen += in_samples; |