From 97321122611f48e005df96fc65fab754e24a27a4 Mon Sep 17 00:00:00 2001 From: Richard Mudgett Date: Tue, 16 Jul 2013 18:48:49 +0000 Subject: Simplify bridge_simple chan join code. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@394470 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- bridges/bridge_simple.c | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/bridges/bridge_simple.c b/bridges/bridge_simple.c index 49e3a35ac..d2019866b 100644 --- a/bridges/bridge_simple.c +++ b/bridges/bridge_simple.c @@ -50,19 +50,14 @@ static int simple_bridge_join(struct ast_bridge *bridge, struct ast_bridge_chann struct ast_channel *c0 = AST_LIST_FIRST(&bridge->channels)->chan; struct ast_channel *c1 = AST_LIST_LAST(&bridge->channels)->chan; - /* If this is the first channel we can't make it compatible... unless we make it compatible with itself O.o */ - if (AST_LIST_FIRST(&bridge->channels) == AST_LIST_LAST(&bridge->channels)) { + /* + * If this is the first channel we can't make it compatible... + * unless we make it compatible with itself. O.o + */ + if (c0 == c1) { return 0; } - /* See if we need to make these compatible */ - if ((ast_format_cmp(ast_channel_writeformat(c0), ast_channel_readformat(c1)) == AST_FORMAT_CMP_EQUAL) && - (ast_format_cmp(ast_channel_readformat(c0), ast_channel_writeformat(c1)) == AST_FORMAT_CMP_EQUAL) && - (ast_format_cap_identical(ast_channel_nativeformats(c0), ast_channel_nativeformats(c1)))) { - return 0; - } - - /* BOOM! We do. */ return ast_channel_make_compatible(c0, c1); } -- cgit v1.2.3