[asterisk-commits] bridge softmix: Don't reorder streams on participant leaving. (asterisk[master])

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Tue Jul 18 08:13:16 CDT 2017


Jenkins2 has submitted this change and it was merged. ( https://gerrit.asterisk.org/6030 )

Change subject: bridge_softmix: Don't reorder streams on participant leaving.
......................................................................

bridge_softmix: Don't reorder streams on participant leaving.

When a participant leaves a bridge while operating in SFU mode
their respective stream on every other participant needs to be
removed. Leaving the stream out of the new topology results in
every stream after it being moved and reordered. This causes
problems with clients. Instead simply mark the stream as removed
which leaves it in place in the SDP and doesn't reorder or touch
any other streams.

ASTERISK-27136

Change-Id: I4b3f840adcdf69b83842b0d8a737665ba0ef9cb1
---
M bridges/bridge_softmix.c
1 file changed, 13 insertions(+), 6 deletions(-)

Approvals:
  Benjamin Keith Ford: Looks good to me, but someone else must approve
  George Joseph: Looks good to me, approved
  Jenkins2: Approved for Submit



diff --git a/bridges/bridge_softmix.c b/bridges/bridge_softmix.c
index ae877eb..9aa8a7a 100644
--- a/bridges/bridge_softmix.c
+++ b/bridges/bridge_softmix.c
@@ -701,14 +701,15 @@
 
 		stream = ast_stream_topology_get_stream(source, i);
 
-		if (is_video_dest(stream, channel_name, NULL)) {
-			continue;
-		}
-
 		stream_clone = ast_stream_clone(stream, NULL);
 		if (!stream_clone) {
 			continue;
 		}
+
+		if (is_video_dest(stream, channel_name, NULL)) {
+			ast_stream_set_state(stream_clone, AST_STREAM_STATE_REMOVED);
+		}
+
 		if (ast_stream_topology_append_stream(dest, stream_clone) < 0) {
 			ast_stream_free(stream_clone);
 		}
@@ -1964,9 +1965,9 @@
 		int num_streams;
 		int params_index[4];
 	} removal_results[] = {
-		{ "PJSIP/Bob-00000001", 3, { 0, 1, 3, -1 }, },
+		{ "PJSIP/Bob-00000001", 4, { 0, 1, 2, 3 }, },
 		{ "PJSIP/Edward-00000004", 4, { 0, 1, 2, 3 }, },
-		{ "", 2, { 0, 1, -1, -1 }, },
+		{ "", 4, { 0, 1, 2, 3 }, },
 	};
 	struct ast_stream_topology *orig = NULL;
 	struct ast_stream_topology *result = NULL;
@@ -2033,6 +2034,12 @@
 					ast_format_cap_get_names(ast_stream_get_formats(actual), &actual_str));
 				goto end;
 			}
+
+			if (is_video_dest(actual, removal_results[i].channel_name, NULL) &&
+				ast_stream_get_state(actual) != AST_STREAM_STATE_REMOVED) {
+				ast_test_status_update(test, "Removed stream %s does not have a state of removed\n", ast_stream_get_name(actual));
+				goto end;
+			}
 		}
 	}
 

-- 
To view, visit https://gerrit.asterisk.org/6030
To unsubscribe, visit https://gerrit.asterisk.org/settings

Gerrit-Project: asterisk
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: I4b3f840adcdf69b83842b0d8a737665ba0ef9cb1
Gerrit-Change-Number: 6030
Gerrit-PatchSet: 2
Gerrit-Owner: Joshua Colp <jcolp at digium.com>
Gerrit-Reviewer: Benjamin Keith Ford <bford at digium.com>
Gerrit-Reviewer: George Joseph <gjoseph at digium.com>
Gerrit-Reviewer: Jenkins2
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-commits/attachments/20170718/ed47dcb0/attachment.html>


More information about the asterisk-commits mailing list