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_alaw.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_alaw.c')
-rw-r--r-- | codecs/codec_alaw.c | 41 |
1 files changed, 5 insertions, 36 deletions
diff --git a/codecs/codec_alaw.c b/codecs/codec_alaw.c index 04d4048b8..4ca897820 100644 --- a/codecs/codec_alaw.c +++ b/codecs/codec_alaw.c @@ -35,10 +35,9 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$") #define BUFFER_SAMPLES 8096 /* size for the translation buffers */ -/* Sample frame data (Mu data is okay) */ - -#include "slin_ulaw_ex.h" -#include "ulaw_slin_ex.h" +/* Sample frame data */ +#include "asterisk/slin.h" +#include "ex_alaw.h" /*! \brief decode frame into lin and fill output buffer. */ static int alawtolin_framein(struct ast_trans_pvt *pvt, struct ast_frame *f) @@ -72,42 +71,12 @@ static int lintoalaw_framein(struct ast_trans_pvt *pvt, struct ast_frame *f) return 0; } -/*! \brief alawToLin_Sample */ -static struct ast_frame *alawtolin_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; - return &f; -} - -/*! \brief LinToalaw_Sample */ -static struct ast_frame *lintoalaw_sample(void) -{ - static struct ast_frame f; - f.frametype = AST_FRAME_VOICE; - f.subclass = AST_FORMAT_SLINEAR; - f.datalen = sizeof(slin_ulaw_ex); - f.samples = sizeof(slin_ulaw_ex) / 2; - f.mallocd = 0; - f.offset = 0; - f.src = __PRETTY_FUNCTION__; - f.data.ptr = slin_ulaw_ex; - return &f; -} - static struct ast_translator alawtolin = { .name = "alawtolin", .srcfmt = AST_FORMAT_ALAW, .dstfmt = AST_FORMAT_SLINEAR, .framein = alawtolin_framein, - .sample = alawtolin_sample, + .sample = alaw_sample, .buffer_samples = BUFFER_SAMPLES, .buf_size = BUFFER_SAMPLES * 2, .plc_samples = 160, @@ -118,7 +87,7 @@ static struct ast_translator lintoalaw = { .srcfmt = AST_FORMAT_SLINEAR, .dstfmt = AST_FORMAT_ALAW, .framein = lintoalaw_framein, - .sample = lintoalaw_sample, + .sample = slin8_sample, .buffer_samples = BUFFER_SAMPLES, .buf_size = BUFFER_SAMPLES, }; |