[asterisk-commits] rmudgett: branch rmudgett/bridge_phase r381699 - in /team/rmudgett/bridge_pha...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Mon Feb 18 15:58:29 CST 2013


Author: rmudgett
Date: Mon Feb 18 15:58:25 2013
New Revision: 381699

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=381699
Log:
Rename struct ast_bridge.num to num_channels

Modified:
    team/rmudgett/bridge_phase/bridges/bridge_softmix.c
    team/rmudgett/bridge_phase/include/asterisk/bridging.h
    team/rmudgett/bridge_phase/main/bridging.c

Modified: team/rmudgett/bridge_phase/bridges/bridge_softmix.c
URL: http://svnview.digium.com/svn/asterisk/team/rmudgett/bridge_phase/bridges/bridge_softmix.c?view=diff&rev=381699&r1=381698&r2=381699
==============================================================================
--- team/rmudgett/bridge_phase/bridges/bridge_softmix.c (original)
+++ team/rmudgett/bridge_phase/bridges/bridge_softmix.c Mon Feb 18 15:58:25 2013
@@ -772,7 +772,7 @@
 	ast_timer_set_rate(timer, (1000 / softmix_data->internal_mixing_interval));
 
 	/* Give the mixing array room to grow, memory is cheap but allocations are expensive. */
-	if (softmix_mixing_array_init(&mixing_array, bridge->num + 10)) {
+	if (softmix_mixing_array_init(&mixing_array, bridge->num_channels + 10)) {
 		goto softmix_cleanup;
 	}
 
@@ -793,8 +793,8 @@
 		}
 
 		/* Grow the mixing array buffer as participants are added. */
-		if (mixing_array.max_num_entries < bridge->num
-			&& softmix_mixing_array_grow(&mixing_array, bridge->num + 5)) {
+		if (mixing_array.max_num_entries < bridge->num_channels
+			&& softmix_mixing_array_grow(&mixing_array, bridge->num_channels + 5)) {
 			goto softmix_cleanup;
 		}
 

Modified: team/rmudgett/bridge_phase/include/asterisk/bridging.h
URL: http://svnview.digium.com/svn/asterisk/team/rmudgett/bridge_phase/include/asterisk/bridging.h?view=diff&rev=381699&r1=381698&r2=381699
==============================================================================
--- team/rmudgett/bridge_phase/include/asterisk/bridging.h (original)
+++ team/rmudgett/bridge_phase/include/asterisk/bridging.h Mon Feb 18 15:58:25 2013
@@ -220,7 +220,7 @@
 	/*! Condition, used if we want to wake up the bridge thread. */
 	ast_cond_t cond;
 	/*! Number of channels participating in the bridge */
-	int num;
+	int num_channels;
 	/*! The video mode this bridge is using */
 	struct ast_bridge_video_mode video_mode;
 	/*! The internal sample rate this bridge is mixed at when multiple channels are being mixed.

Modified: team/rmudgett/bridge_phase/main/bridging.c
URL: http://svnview.digium.com/svn/asterisk/team/rmudgett/bridge_phase/main/bridging.c?view=diff&rev=381699&r1=381698&r2=381699
==============================================================================
--- team/rmudgett/bridge_phase/main/bridging.c (original)
+++ team/rmudgett/bridge_phase/main/bridging.c Mon Feb 18 15:58:25 2013
@@ -1317,7 +1317,7 @@
 
 	/* Add channel into the bridge */
 	AST_LIST_INSERT_TAIL(&bridge_channel->bridge->channels, bridge_channel, entry);
-	bridge_channel->bridge->num++;
+	++bridge_channel->bridge->num_channels;
 
 	bridge_array_add(bridge_channel->bridge, bridge_channel->chan);
 
@@ -1346,7 +1346,7 @@
 		}
 	} else if (ast_test_flag(&bridge_channel->bridge->feature_flags, AST_BRIDGE_FLAG_SMART)) {
 		/* Perform the smart bridge operation, basically see if we need to move around between technologies */
-		smart_bridge_operation(bridge_channel->bridge, bridge_channel, bridge_channel->bridge->num);
+		smart_bridge_operation(bridge_channel->bridge, bridge_channel, bridge_channel->bridge->num_channels);
 	}
 
 	/* Make the channel compatible with the bridge */
@@ -1452,7 +1452,7 @@
 	}
 
 	/* Remove channel from the bridge */
-	bridge_channel->bridge->num--;
+	--bridge_channel->bridge->num_channels;
 	AST_LIST_REMOVE(&bridge_channel->bridge->channels, bridge_channel, entry);
 
 	if (bridge_channel->depart_wait) {
@@ -1471,7 +1471,7 @@
 
 	/* Perform the smart bridge operation if needed since a channel has left */
 	if (ast_test_flag(&bridge_channel->bridge->feature_flags, AST_BRIDGE_FLAG_SMART)) {
-		smart_bridge_operation(bridge_channel->bridge, NULL, bridge_channel->bridge->num);
+		smart_bridge_operation(bridge_channel->bridge, NULL, bridge_channel->bridge->num_channels);
 	}
 
 	ao2_unlock(bridge_channel->bridge);
@@ -2087,7 +2087,7 @@
 	ao2_lock(bridge1);
 
 	/* If the first bridge currently has 2 channels and is not capable of becoming a multimixing bridge we can not merge */
-	if (bridge0->num + bridge1->num > 2
+	if (bridge0->num_channels + bridge1->num_channels > 2
 		&& !(bridge0->technology->capabilities & AST_BRIDGE_CAPABILITY_MULTIMIX)
 		&& !ast_test_flag(&bridge0->feature_flags, AST_BRIDGE_FLAG_SMART)) {
 		ao2_unlock(bridge1);
@@ -2099,7 +2099,7 @@
 	ast_debug(1, "Merging channels from bridge %p into bridge %p\n", bridge1, bridge0);
 
 	/* Perform smart bridge operation on bridge we are merging into so it can change bridge technology if needed */
-	if (smart_bridge_operation(bridge0, NULL, bridge0->num + bridge1->num)) {
+	if (smart_bridge_operation(bridge0, NULL, bridge0->num_channels + bridge1->num_channels)) {
 		ao2_unlock(bridge1);
 		ao2_unlock(bridge0);
 		ast_debug(1, "Can't merge bridge %p into bridge %p, tried to perform smart bridge operation and failed.\n", bridge1, bridge0);
@@ -2127,7 +2127,7 @@
 		}
 
 		/* Drop channel count and reference count on the bridge they are leaving */
-		bridge1->num--;
+		--bridge1->num_channels;
 		ao2_ref(bridge1, -1);
 
 		bridge_array_remove(bridge1, bridge_channel->chan);
@@ -2135,7 +2135,7 @@
 		/* Now add them into the bridge they are joining, increase channel count, and bump up reference count */
 		bridge_channel->bridge = bridge0;
 		AST_LIST_INSERT_TAIL(&bridge0->channels, bridge_channel, entry);
-		bridge0->num++;
+		++bridge0->num_channels;
 		ao2_ref(bridge0, +1);
 
 		bridge_array_add(bridge0, bridge_channel->chan);




More information about the asterisk-commits mailing list