summaryrefslogtreecommitdiff
path: root/codecs/codec_ulaw.c
diff options
context:
space:
mode:
Diffstat (limited to 'codecs/codec_ulaw.c')
-rw-r--r--codecs/codec_ulaw.c20
1 files changed, 12 insertions, 8 deletions
diff --git a/codecs/codec_ulaw.c b/codecs/codec_ulaw.c
index 07f5da39d..b5211a585 100644
--- a/codecs/codec_ulaw.c
+++ b/codecs/codec_ulaw.c
@@ -78,8 +78,6 @@ static int lintoulaw_framein(struct ast_trans_pvt *pvt, struct ast_frame *f)
static struct ast_translator ulawtolin = {
.name = "ulawtolin",
- .srcfmt = AST_FORMAT_ULAW,
- .dstfmt = AST_FORMAT_SLINEAR,
.framein = ulawtolin_framein,
.sample = ulaw_sample,
.buffer_samples = BUFFER_SAMPLES,
@@ -88,8 +86,6 @@ static struct ast_translator ulawtolin = {
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,
@@ -102,8 +98,6 @@ static struct ast_translator testlawtolin = {
static struct ast_translator lintoulaw = {
.name = "lintoulaw",
- .srcfmt = AST_FORMAT_SLINEAR,
- .dstfmt = AST_FORMAT_ULAW,
.framein = lintoulaw_framein,
.sample = slin8_sample,
.buf_size = BUFFER_SAMPLES,
@@ -112,8 +106,6 @@ static struct ast_translator lintoulaw = {
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,
@@ -141,6 +133,18 @@ static int load_module(void)
{
int res;
+ ast_format_set(&lintoulaw.src_format, AST_FORMAT_SLINEAR, 0);
+ ast_format_set(&lintoulaw.dst_format, AST_FORMAT_ULAW, 0);
+
+ ast_format_set(&lintotestlaw.src_format, AST_FORMAT_SLINEAR, 0);
+ ast_format_set(&lintotestlaw.dst_format, AST_FORMAT_TESTLAW, 0);
+
+ ast_format_set(&ulawtolin.src_format, AST_FORMAT_ULAW, 0);
+ ast_format_set(&ulawtolin.dst_format, AST_FORMAT_SLINEAR, 0);
+
+ ast_format_set(&testlawtolin.src_format, AST_FORMAT_TESTLAW, 0);
+ ast_format_set(&testlawtolin.dst_format, AST_FORMAT_SLINEAR, 0);
+
res = ast_register_translator(&ulawtolin);
if (!res) {
res = ast_register_translator(&lintoulaw);