diff options
author | Richard Mudgett <rmudgett@digium.com> | 2015-04-10 16:37:20 +0000 |
---|---|---|
committer | Richard Mudgett <rmudgett@digium.com> | 2015-04-10 16:37:20 +0000 |
commit | 125acc52fea2dbace7ab8e4f68d6a09e975a0bc1 (patch) | |
tree | 466a62c891d34c454391dc6fa0d4cc1b72b316a6 /main/channel.c | |
parent | a63f7ad04a00bfe8e6b47fd1a60de6691813c0d1 (diff) |
bridge_softmix.c,channel.c: Minor code simplification and cleanup.
* Made code easier to follow in bridge_softmix.c:analyse_softmix_stats()
and made some debug messages more helpful.
* Made some debug and warning messages more helpful in
channel.c:set_format().
Review: https://reviewboard.asterisk.org/r/4607/
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/13@434617 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'main/channel.c')
-rw-r--r-- | main/channel.c | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/main/channel.c b/main/channel.c index a3420cfd3..934dd6651 100644 --- a/main/channel.c +++ b/main/channel.c @@ -5337,15 +5337,16 @@ static int set_format(struct ast_channel *chan, struct ast_format_cap *cap_set, res = ast_translator_best_choice(cap_native, cap_set, &best_native_fmt, &best_set_fmt); } if (res < 0) { - struct ast_str *codec_from = ast_str_alloca(64); - struct ast_str *codec_to = ast_str_alloca(64); + struct ast_str *codec_native = ast_str_alloca(256); + struct ast_str *codec_set = ast_str_alloca(256); - ast_format_cap_get_names(cap_native, &codec_from); + ast_format_cap_get_names(cap_native, &codec_native); ast_channel_unlock(chan); - ast_format_cap_get_names(cap_set, &codec_to); + ast_format_cap_get_names(cap_set, &codec_set); - ast_log(LOG_WARNING, "Unable to find a codec translation path from %s to %s\n", - ast_str_buffer(codec_from), ast_str_buffer(codec_to)); + ast_log(LOG_WARNING, "Unable to find a codec translation path: %s -> %s\n", + ast_str_buffer(direction ? codec_set : codec_native), + ast_str_buffer(direction ? codec_native : codec_set)); return -1; } @@ -5389,10 +5390,11 @@ static int set_format(struct ast_channel *chan, struct ast_format_cap *cap_set, access->set_format(chan, best_set_fmt); access->set_rawformat(chan, best_native_fmt); - ast_debug(1, "Set channel %s to %s format %s\n", + ast_debug(1, "Channel %s setting %s format path: %s -> %s\n", ast_channel_name(chan), access->direction, - ast_format_get_name(best_set_fmt)); + ast_format_get_name(direction ? best_set_fmt : best_native_fmt), + ast_format_get_name(direction ? best_native_fmt : best_set_fmt)); } ast_channel_unlock(chan); |