diff options
author | qwell <qwell@f38db490-d61c-443f-a65b-d21fe96a405b> | 2008-10-17 21:35:23 +0000 |
---|---|---|
committer | qwell <qwell@f38db490-d61c-443f-a65b-d21fe96a405b> | 2008-10-17 21:35:23 +0000 |
commit | ba0313e902c8570c0f164892b591197ddc91b4c0 (patch) | |
tree | c905fae44bb51b0871baf6bea17f10d715963052 /codecs/codec_a_mu.c | |
parent | 236e62078c388457c14a6bbc1c007b1c83a3edd7 (diff) |
Merge codec_consistency branch. This should make sample usage much happier.
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@150729 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'codecs/codec_a_mu.c')
-rw-r--r-- | codecs/codec_a_mu.c | 41 |
1 files changed, 5 insertions, 36 deletions
diff --git a/codecs/codec_a_mu.c b/codecs/codec_a_mu.c index cf0354720..9b2e40850 100644 --- a/codecs/codec_a_mu.c +++ b/codecs/codec_a_mu.c @@ -38,9 +38,9 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$") static unsigned char mu2a[256]; static unsigned char a2mu[256]; -/* Sample frame data (Mu data is okay) */ - -#include "ulaw_slin_ex.h" +/* Sample frame data */ +#include "ex_ulaw.h" +#include "ex_alaw.h" /*! \brief convert frame data and store into the buffer */ static int alawtoulaw_framein(struct ast_trans_pvt *pvt, struct ast_frame *f) @@ -74,43 +74,12 @@ static int ulawtoalaw_framein(struct ast_trans_pvt *pvt, struct ast_frame *f) return 0; } -/* - * alawToLin_Sample. Just random data, somehow... - */ -static struct ast_frame *alawtoulaw_sample(void) -{ - static struct ast_frame f; - f.frametype = AST_FRAME_VOICE; - f.subclass = AST_FORMAT_ALAW; - f.datalen = sizeof(ulaw_slin_ex); - f.samples = sizeof(ulaw_slin_ex); - f.mallocd = 0; - f.offset = 0; - f.src = __PRETTY_FUNCTION__; - f.data.ptr = ulaw_slin_ex; /* XXX what ? */ - return &f; -} - -static struct ast_frame *ulawtoalaw_sample(void) -{ - static struct ast_frame f; - f.frametype = AST_FRAME_VOICE; - f.subclass = AST_FORMAT_ULAW; - f.datalen = sizeof(ulaw_slin_ex); - f.samples = sizeof(ulaw_slin_ex); - f.mallocd = 0; - f.offset = 0; - f.src = __PRETTY_FUNCTION__; - f.data.ptr = ulaw_slin_ex; - return &f; -} - static struct ast_translator alawtoulaw = { .name = "alawtoulaw", .srcfmt = AST_FORMAT_ALAW, .dstfmt = AST_FORMAT_ULAW, .framein = alawtoulaw_framein, - .sample = alawtoulaw_sample, + .sample = alaw_sample, .buffer_samples = BUFFER_SAMPLES, .buf_size = BUFFER_SAMPLES, }; @@ -120,7 +89,7 @@ static struct ast_translator ulawtoalaw = { .srcfmt = AST_FORMAT_ULAW, .dstfmt = AST_FORMAT_ALAW, .framein = ulawtoalaw_framein, - .sample = ulawtoalaw_sample, + .sample = ulaw_sample, .buffer_samples = BUFFER_SAMPLES, .buf_size = BUFFER_SAMPLES, }; |