aboutsummaryrefslogtreecommitdiffstats
path: root/main/translate.c
diff options
context:
space:
mode:
Diffstat (limited to 'main/translate.c')
-rw-r--r--main/translate.c14
1 files changed, 3 insertions, 11 deletions
diff --git a/main/translate.c b/main/translate.c
index 0aa21df12..3f5466d1f 100644
--- a/main/translate.c
+++ b/main/translate.c
@@ -306,14 +306,6 @@ struct ast_trans_pvt *ast_translator_build_path(int dest, int source)
return head;
}
-static inline int format_rate(int format)
-{
- if (format == AST_FORMAT_G722)
- return 16000;
-
- return 8000;
-}
-
/*! \brief do the actual translation */
struct ast_frame *ast_translate(struct ast_trans_pvt *path, struct ast_frame *f, int consume)
{
@@ -350,7 +342,7 @@ struct ast_frame *ast_translate(struct ast_trans_pvt *path, struct ast_frame *f,
path->nextout = f->delivery;
}
/* Predict next incoming sample */
- path->nextin = ast_tvadd(path->nextin, ast_samp2tv(f->samples, format_rate(f->subclass)));
+ path->nextin = ast_tvadd(path->nextin, ast_samp2tv(f->samples, ast_format_rate(f->subclass)));
}
delivery = f->delivery;
for ( ; out && p ; p = p->next) {
@@ -374,7 +366,7 @@ struct ast_frame *ast_translate(struct ast_trans_pvt *path, struct ast_frame *f,
/* Predict next outgoing timestamp from samples in this
frame. */
- path->nextout = ast_tvadd(path->nextout, ast_samp2tv(out->samples, format_rate(out->subclass)));
+ path->nextout = ast_tvadd(path->nextout, ast_samp2tv(out->samples, ast_format_rate(out->subclass)));
} else {
out->delivery = ast_tv(0, 0);
ast_set2_flag(out, has_timing_info, AST_FRFLAG_HAS_TIMING_INFO);
@@ -397,7 +389,7 @@ static void calc_cost(struct ast_translator *t, int seconds)
struct ast_trans_pvt *pvt;
struct timeval start;
int cost;
- int out_rate = format_rate(t->dstfmt);
+ int out_rate = ast_format_rate(t->dstfmt);
if (!seconds)
seconds = 1;