summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoshua Colp <jcolp@digium.com>2018-04-20 12:40:01 +0000
committerJoshua Colp <jcolp@digium.com>2018-04-20 15:25:08 -0600
commitde9c0ede4a74796efad0a7736897db71548d727b (patch)
treef3db2e2c3b54fa08f8ee1e6523dae174361aa984
parenta9c74fdc0462349bd9ae6f25ae72f071c95d1e76 (diff)
bridge_softmix: Fix sporadic incorrect video stream mapping.
When an externally initiated renegotiation occurred it was possible for video streams to be incorrectly remapped, resulting in no video flowing to some receivers. This change ensures that only the video source sets up mappings and also that removed streams do not have mappings set up. Change-Id: Iab05f2254df3606670774844bb0935f833d3a9b0
-rw-r--r--bridges/bridge_softmix.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/bridges/bridge_softmix.c b/bridges/bridge_softmix.c
index f0a3fb42d..b222dde04 100644
--- a/bridges/bridge_softmix.c
+++ b/bridges/bridge_softmix.c
@@ -2148,12 +2148,13 @@ static void softmix_bridge_stream_topology_changed(struct ast_bridge *bridge, st
AST_VECTOR_SIZE(&media_types) - 1, &bridge->channels);
ast_bridge_channel_lock(participant);
ast_channel_lock(participant->chan);
- } else if (is_video_dest(stream, NULL, NULL)) {
- /* We expect to never read media from video destination channels, but just
- * in case, we should set their to_bridge value to -1.
+ } else if (ast_stream_get_type(stream) == AST_MEDIA_TYPE_VIDEO) {
+ /* Video stream mapping occurs directly when a video source stream
+ * is found on a channel. Video streams should otherwise remain
+ * unmapped.
*/
AST_VECTOR_REPLACE(&participant->stream_map.to_bridge, i, -1);
- } else {
+ } else if (ast_stream_get_state(stream) != AST_STREAM_STATE_REMOVED) {
/* XXX This is copied from ast_stream_topology_map(). This likely could
* be factored out in some way
*/