mirror of
https://github.com/asterisk/asterisk.git
synced 2025-11-16 14:58:25 +00:00
suppress smoothers for Siren codecs as well as Speex and G.723.1
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@176841 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
13
main/rtp.c
13
main/rtp.c
@@ -3735,8 +3735,18 @@ int ast_rtp_write(struct ast_rtp *rtp, struct ast_frame *_f)
|
|||||||
rtp->smoother = NULL;
|
rtp->smoother = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!rtp->smoother && subclass != AST_FORMAT_SPEEX && subclass != AST_FORMAT_G723_1) {
|
if (!rtp->smoother) {
|
||||||
struct ast_format_list fmt = ast_codec_pref_getsize(&rtp->pref, subclass);
|
struct ast_format_list fmt = ast_codec_pref_getsize(&rtp->pref, subclass);
|
||||||
|
|
||||||
|
switch (subclass) {
|
||||||
|
case AST_FORMAT_SPEEX:
|
||||||
|
case AST_FORMAT_G723_1:
|
||||||
|
case AST_FORMAT_SIREN7:
|
||||||
|
case AST_FORMAT_SIREN14:
|
||||||
|
/* these are all frame-based codecs and cannot be safely run through
|
||||||
|
a smoother */
|
||||||
|
break;
|
||||||
|
default:
|
||||||
if (fmt.inc_ms) { /* if codec parameters is set / avoid division by zero */
|
if (fmt.inc_ms) { /* if codec parameters is set / avoid division by zero */
|
||||||
if (!(rtp->smoother = ast_smoother_new((fmt.cur_ms * fmt.fr_len) / fmt.inc_ms))) {
|
if (!(rtp->smoother = ast_smoother_new((fmt.cur_ms * fmt.fr_len) / fmt.inc_ms))) {
|
||||||
ast_log(LOG_WARNING, "Unable to create smoother: format: %d ms: %d len: %d\n", subclass, fmt.cur_ms, ((fmt.cur_ms * fmt.fr_len) / fmt.inc_ms));
|
ast_log(LOG_WARNING, "Unable to create smoother: format: %d ms: %d len: %d\n", subclass, fmt.cur_ms, ((fmt.cur_ms * fmt.fr_len) / fmt.inc_ms));
|
||||||
@@ -3747,6 +3757,7 @@ int ast_rtp_write(struct ast_rtp *rtp, struct ast_frame *_f)
|
|||||||
ast_debug(1, "Created smoother: format: %d ms: %d len: %d\n", subclass, fmt.cur_ms, ((fmt.cur_ms * fmt.fr_len) / fmt.inc_ms));
|
ast_debug(1, "Created smoother: format: %d ms: %d len: %d\n", subclass, fmt.cur_ms, ((fmt.cur_ms * fmt.fr_len) / fmt.inc_ms));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
if (rtp->smoother) {
|
if (rtp->smoother) {
|
||||||
if (ast_smoother_test_flag(rtp->smoother, AST_SMOOTHER_FLAG_BE)) {
|
if (ast_smoother_test_flag(rtp->smoother, AST_SMOOTHER_FLAG_BE)) {
|
||||||
ast_smoother_feed_be(rtp->smoother, _f);
|
ast_smoother_feed_be(rtp->smoother, _f);
|
||||||
|
|||||||
Reference in New Issue
Block a user