aboutsummaryrefslogtreecommitdiffstats
path: root/codecs/codec_g722.c
diff options
context:
space:
mode:
Diffstat (limited to 'codecs/codec_g722.c')
-rw-r--r--codecs/codec_g722.c20
1 files changed, 12 insertions, 8 deletions
diff --git a/codecs/codec_g722.c b/codecs/codec_g722.c
index 22196da01..9c3a01846 100644
--- a/codecs/codec_g722.c
+++ b/codecs/codec_g722.c
@@ -134,8 +134,6 @@ static int lintog722_framein(struct ast_trans_pvt *pvt, struct ast_frame *f)
static struct ast_translator g722tolin = {
.name = "g722tolin",
- .srcfmt = AST_FORMAT_G722,
- .dstfmt = AST_FORMAT_SLINEAR,
.newpvt = g722tolin_new, /* same for both directions */
.framein = g722tolin_framein,
.sample = g722_sample,
@@ -146,8 +144,6 @@ static struct ast_translator g722tolin = {
static struct ast_translator lintog722 = {
.name = "lintog722",
- .srcfmt = AST_FORMAT_SLINEAR,
- .dstfmt = AST_FORMAT_G722,
.newpvt = lintog722_new, /* same for both directions */
.framein = lintog722_framein,
.sample = slin8_sample,
@@ -158,8 +154,6 @@ static struct ast_translator lintog722 = {
static struct ast_translator g722tolin16 = {
.name = "g722tolin16",
- .srcfmt = AST_FORMAT_G722,
- .dstfmt = AST_FORMAT_SLINEAR16,
.newpvt = g722tolin16_new, /* same for both directions */
.framein = g722tolin_framein,
.sample = g722_sample,
@@ -170,8 +164,6 @@ static struct ast_translator g722tolin16 = {
static struct ast_translator lin16tog722 = {
.name = "lin16tog722",
- .srcfmt = AST_FORMAT_SLINEAR16,
- .dstfmt = AST_FORMAT_G722,
.newpvt = lin16tog722_new, /* same for both directions */
.framein = lintog722_framein,
.sample = slin16_sample,
@@ -201,6 +193,18 @@ static int load_module(void)
{
int res = 0;
+ ast_format_set(&g722tolin.src_format, AST_FORMAT_G722, 0);
+ ast_format_set(&g722tolin.dst_format, AST_FORMAT_SLINEAR, 0);
+
+ ast_format_set(&lintog722.src_format, AST_FORMAT_SLINEAR, 0);
+ ast_format_set(&lintog722.dst_format, AST_FORMAT_G722, 0);
+
+ ast_format_set(&g722tolin16.src_format, AST_FORMAT_G722, 0);
+ ast_format_set(&g722tolin16.dst_format, AST_FORMAT_SLINEAR16, 0);
+
+ ast_format_set(&lin16tog722.src_format, AST_FORMAT_SLINEAR16, 0);
+ ast_format_set(&lin16tog722.dst_format, AST_FORMAT_G722, 0);
+
res |= ast_register_translator(&g722tolin);
res |= ast_register_translator(&lintog722);
res |= ast_register_translator(&g722tolin16);