summaryrefslogtreecommitdiff
path: root/main/channel.c
diff options
context:
space:
mode:
authorRichard Mudgett <rmudgett@digium.com>2014-08-14 15:54:47 +0000
committerRichard Mudgett <rmudgett@digium.com>2014-08-14 15:54:47 +0000
commit7eb4ee9b2f991cd269d2ae5b8432690407796f43 (patch)
treef69cc95d6d90527bb63f9ab68e9552fc08db5a1a /main/channel.c
parentcd81f920a483ef734ec69a14b252288704cd656d (diff)
channel_internal_api.c: Replace some code with ao2_replace().
Use ao2_replace() instead of ao2_cleanup(); ao2_bump(). ao2_replace() has the advantange of not altering the ref count if the replaced pointer is the same. Review: https://reviewboard.asterisk.org/r/3904/ git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/13@420992 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'main/channel.c')
-rw-r--r--main/channel.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/main/channel.c b/main/channel.c
index 5681ec1a5..287ed305e 100644
--- a/main/channel.c
+++ b/main/channel.c
@@ -6244,8 +6244,7 @@ static int ast_channel_make_compatible_helper(struct ast_channel *from, struct a
ast_format_get_sample_rate(best_src_fmt) : ast_format_get_sample_rate(best_dst_fmt);
/* pick the best signed linear format based upon what preserves the sample rate the best. */
- ao2_ref(best_src_fmt, -1);
- best_src_fmt = ao2_bump(ast_format_cache_get_slin_by_rate(best_sample_rate));
+ ao2_replace(best_src_fmt, ast_format_cache_get_slin_by_rate(best_sample_rate));
}
}