diff options
author | tilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b> | 2009-11-04 14:05:12 +0000 |
---|---|---|
committer | tilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b> | 2009-11-04 14:05:12 +0000 |
commit | 3bacd4082e2d3a2dd5b8b13635df956aa4f415cd (patch) | |
tree | dd3bc244b8a45aacb932109dc8c12d1f21769d55 /codecs/codec_ulaw.c | |
parent | 1d3ce2ae5f81e30ec0704efe840bc2c9a24c7e8a (diff) |
Expand codec bitfield from 32 bits to 64 bits.
Reviewboard: https://reviewboard.asterisk.org/r/416/
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@227580 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'codecs/codec_ulaw.c')
-rw-r--r-- | codecs/codec_ulaw.c | 29 |
1 files changed, 27 insertions, 2 deletions
diff --git a/codecs/codec_ulaw.c b/codecs/codec_ulaw.c index 4d1c8a1ae..9ed9d550d 100644 --- a/codecs/codec_ulaw.c +++ b/codecs/codec_ulaw.c @@ -87,6 +87,17 @@ static struct ast_translator ulawtolin = { .plc_samples = 160, }; +static struct ast_translator testlawtolin = { + .name = "testlawtolin", + .srcfmt = AST_FORMAT_TESTLAW, + .dstfmt = AST_FORMAT_SLINEAR, + .framein = ulawtolin_framein, + .sample = ulaw_sample, + .buffer_samples = BUFFER_SAMPLES, + .buf_size = BUFFER_SAMPLES * 2, + .plc_samples = 160, +}; + /*! * \brief The complete translator for LinToulaw. */ @@ -101,6 +112,16 @@ static struct ast_translator lintoulaw = { .buffer_samples = BUFFER_SAMPLES, }; +static struct ast_translator lintotestlaw = { + .name = "lintotestlaw", + .srcfmt = AST_FORMAT_SLINEAR, + .dstfmt = AST_FORMAT_TESTLAW, + .framein = lintoulaw_framein, + .sample = slin8_sample, + .buf_size = BUFFER_SAMPLES, + .buffer_samples = BUFFER_SAMPLES, +}; + static int parse_config(int reload) { struct ast_variable *var; @@ -131,6 +152,8 @@ static int unload_module(void) res = ast_unregister_translator(&lintoulaw); res |= ast_unregister_translator(&ulawtolin); + res |= ast_unregister_translator(&testlawtolin); + res |= ast_unregister_translator(&lintotestlaw); return res; } @@ -142,9 +165,11 @@ static int load_module(void) if (parse_config(0)) return AST_MODULE_LOAD_DECLINE; res = ast_register_translator(&ulawtolin); - if (!res) + if (!res) { res = ast_register_translator(&lintoulaw); - else + res |= ast_register_translator(&lintotestlaw); + res |= ast_register_translator(&testlawtolin); + } else ast_unregister_translator(&ulawtolin); if (res) return AST_MODULE_LOAD_FAILURE; |