diff options
author | zuul <zuul@gerrit.asterisk.org> | 2017-02-01 14:50:17 -0600 |
---|---|---|
committer | Gerrit Code Review <gerrit2@gerrit.digium.api> | 2017-02-01 14:50:18 -0600 |
commit | e4f742de15cc6683172266c1796fbeaf57be6425 (patch) | |
tree | 9691ffd244889055a9e751a40bbab481d29ccc6c | |
parent | 7fd28cefdb2a41308b22b6e29d9a10ff38acb2e5 (diff) | |
parent | 339c30f2b65b005817b073bc9b7c8ad2e7e3fde9 (diff) |
Merge "res_rtp_asterisk: Swap byte-order when sending signed linear" into 13
-rw-r--r-- | res/res_rtp_asterisk.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/res/res_rtp_asterisk.c b/res/res_rtp_asterisk.c index 43d0ae20a..ba2d81550 100644 --- a/res/res_rtp_asterisk.c +++ b/res/res_rtp_asterisk.c @@ -3634,6 +3634,11 @@ static int ast_rtp_write(struct ast_rtp_instance *instance, struct ast_frame *fr /* If no smoother is present see if we have to set one up */ if (!rtp->smoother && ast_format_can_be_smoothed(format)) { unsigned int framing_ms = ast_rtp_codecs_get_framing(ast_rtp_instance_get_codecs(instance)); + int is_slinear = ast_format_cache_is_slinear(format); + + if (!framing_ms && is_slinear) { + framing_ms = ast_format_get_default_ms(format); + } if (framing_ms) { rtp->smoother = ast_smoother_new((framing_ms * ast_format_get_minimum_bytes(format)) / ast_format_get_minimum_ms(format)); @@ -3642,6 +3647,9 @@ static int ast_rtp_write(struct ast_rtp_instance *instance, struct ast_frame *fr ast_format_get_name(format), framing_ms, ast_format_get_minimum_bytes(format)); return -1; } + if (is_slinear) { + ast_smoother_set_flags(rtp->smoother, AST_SMOOTHER_FLAG_BE); + } } } |