summaryrefslogtreecommitdiff
path: root/bridges
diff options
context:
space:
mode:
authorRichard Mudgett <rmudgett@digium.com>2013-01-09 22:56:08 +0000
committerRichard Mudgett <rmudgett@digium.com>2013-01-09 22:56:08 +0000
commite342ffb96987dadd019542d1d205970b9d9b6e2d (patch)
tree22fcd8425352dce40329941f2edb38992788fc6a /bridges
parent32cb4ca542fda0f6a0026cd78d30a93abda78716 (diff)
Trivial misc bridge code changes.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@378840 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'bridges')
-rw-r--r--bridges/bridge_multiplexed.c13
-rw-r--r--bridges/bridge_simple.c2
2 files changed, 4 insertions, 11 deletions
diff --git a/bridges/bridge_multiplexed.c b/bridges/bridge_multiplexed.c
index cd3026647..432c7e277 100644
--- a/bridges/bridge_multiplexed.c
+++ b/bridges/bridge_multiplexed.c
@@ -90,8 +90,6 @@ static void destroy_multiplexed_thread(void *obj)
if (multiplexed_thread->pipe[1] > -1) {
close(multiplexed_thread->pipe[1]);
}
-
- return;
}
/*! \brief Create function which finds/reserves/references a multiplexed thread structure */
@@ -173,8 +171,6 @@ static void multiplexed_nudge(struct multiplexed_thread *multiplexed_thread)
while (multiplexed_thread->waiting) {
sched_yield();
}
-
- return;
}
/*! \brief Destroy function which unreserves/unreferences/removes a multiplexed thread structure */
@@ -308,8 +304,6 @@ static void multiplexed_add_or_remove(struct multiplexed_thread *multiplexed_thr
if (thread != AST_PTHREADT_NULL) {
pthread_join(thread, NULL);
}
-
- return;
}
/*! \brief Join function which actually adds the channel into the array to be monitored */
@@ -356,8 +350,6 @@ static void multiplexed_bridge_suspend(struct ast_bridge *bridge, struct ast_bri
ast_debug(1, "Suspending channel '%s' from multiplexed thread '%p'\n", ast_channel_name(bridge_channel->chan), multiplexed_thread);
multiplexed_add_or_remove(multiplexed_thread, bridge_channel->chan, 0);
-
- return;
}
/*! \brief Unsuspend function which means control of the channel is coming back to us */
@@ -368,8 +360,6 @@ static void multiplexed_bridge_unsuspend(struct ast_bridge *bridge, struct ast_b
ast_debug(1, "Unsuspending channel '%s' from multiplexed thread '%p'\n", ast_channel_name(bridge_channel->chan), multiplexed_thread);
multiplexed_add_or_remove(multiplexed_thread, bridge_channel->chan, 1);
-
- return;
}
/*! \brief Write function for writing frames into the bridge */
@@ -377,14 +367,17 @@ static enum ast_bridge_write_result multiplexed_bridge_write(struct ast_bridge *
{
struct ast_bridge_channel *other;
+ /* If this is the only channel in this bridge then immediately exit */
if (AST_LIST_FIRST(&bridge->channels) == AST_LIST_LAST(&bridge->channels)) {
return AST_BRIDGE_WRITE_FAILED;
}
+ /* Find the channel we actually want to write to */
if (!(other = (AST_LIST_FIRST(&bridge->channels) == bridge_channel ? AST_LIST_LAST(&bridge->channels) : AST_LIST_FIRST(&bridge->channels)))) {
return AST_BRIDGE_WRITE_FAILED;
}
+ /* Write the frame out if they are in the waiting state... don't worry about freeing it, the bridging core will take care of it */
if (other->state == AST_BRIDGE_CHANNEL_STATE_WAIT) {
ast_write(other->chan, frame);
}
diff --git a/bridges/bridge_simple.c b/bridges/bridge_simple.c
index 69e41140d..93864e6de 100644
--- a/bridges/bridge_simple.c
+++ b/bridges/bridge_simple.c
@@ -67,7 +67,7 @@ static int simple_bridge_join(struct ast_bridge *bridge, struct ast_bridge_chann
static enum ast_bridge_write_result simple_bridge_write(struct ast_bridge *bridge, struct ast_bridge_channel *bridge_channel, struct ast_frame *frame)
{
- struct ast_bridge_channel *other = NULL;
+ struct ast_bridge_channel *other;
/* If this is the only channel in this bridge then immediately exit */
if (AST_LIST_FIRST(&bridge->channels) == AST_LIST_LAST(&bridge->channels)) {