[asterisk-commits] file: branch file/bridging-softmixgen2 r180792 - /team/file/bridging-softmixg...
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Mon Mar 9 21:54:09 CDT 2009
Author: file
Date: Mon Mar 9 21:54:05 2009
New Revision: 180792
URL: http://svn.digium.com/svn-view/asterisk?view=rev&rev=180792
Log:
Finally... exchange audio between the different active segments if possible.
Modified:
team/file/bridging-softmixgen2/bridges/bridge_softmix.c
Modified: team/file/bridging-softmixgen2/bridges/bridge_softmix.c
URL: http://svn.digium.com/svn-view/asterisk/team/file/bridging-softmixgen2/bridges/bridge_softmix.c?view=diff&rev=180792&r1=180791&r2=180792
==============================================================================
--- team/file/bridging-softmixgen2/bridges/bridge_softmix.c (original)
+++ team/file/bridging-softmixgen2/bridges/bridge_softmix.c Mon Mar 9 21:54:05 2009
@@ -288,7 +288,7 @@
static int softmix_bridge_fd(struct ast_bridge *bridge, struct ast_bridge_channel *bridge_channel, int fd)
{
struct softmix_bridge *softmix_bridge = bridge->bridge_pvt;
- int i;
+ int i, j;
ast_timer_ack(softmix_bridge->timingfd, 1);
@@ -302,6 +302,26 @@
}
/* Exchange audio between any bridge segments */
+ for (i = 0; i < SOFTMIX_SEGMENTS_MAX; i++) {
+ if (!softmix_bridge->segments[i].channels) {
+ continue;
+ }
+ for (j = 0; j < SOFTMIX_SEGMENTS_MAX; j++) {
+ struct ast_frame *frame;
+
+ if (!softmix_bridge->segments[j].channels == 0 || i == j || !softmix_bridge->segments[i].paths[j]) {
+ continue;
+ }
+
+ if (!(frame = ast_translate(softmix_bridge->segments[i].paths[j], &softmix_bridge->segments[i].frame, 0))) {
+ continue;
+ }
+
+ ast_frame_slinear_sum(&softmix_bridge->segments[j].frame, frame);
+
+ ast_frfree(frame);
+ }
+ }
/* Write out the audio from each frame to the individual channels */
AST_LIST_TRAVERSE(&bridge->channels, bridge_channel, entry) {
More information about the asterisk-commits
mailing list