]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
bridge_softmix: Add additional old states for adding new source.
authorJoshua C. Colp <jcolp@sangoma.com>
Wed, 10 Jun 2020 17:11:16 +0000 (14:11 -0300)
committerFriendly Automation <jenkins2@gerrit.asterisk.org>
Thu, 11 Jun 2020 21:57:26 +0000 (16:57 -0500)
There are three states that an old stream can be in to allow
becoming a source stream in a new stream:

1. Removed
2. Inactive
3. Sendonly

This change adds the two missing ones, inactive and sendonly,
so if a stream transitions from those to a state where they are
providing video to Asterisk we properly re-negotiate the other
participants.

ASTERISK-28944

Change-Id: Id8256b9b254b403411586284bbaedbf50452de01

bridges/bridge_softmix.c

index 36d82a53c50af86b0506de9912aa393323e98498..817f8b2a91dae1f5b15d34df548ad0670bad537f 100644 (file)
@@ -2293,7 +2293,8 @@ static void softmix_bridge_stream_sources_update(struct ast_bridge *bridge, stru
                                ast_stream_get_state(new_stream) != AST_STREAM_STATE_SENDRECV && ast_stream_get_state(new_stream) != AST_STREAM_STATE_RECVONLY) {
                        /* If a stream renegotiates and is removed then we remove it */
                        removed_streams[removed_streams_count++] = index;
-               } else if (ast_stream_get_state(old_stream) == AST_STREAM_STATE_REMOVED &&
+               } else if ((ast_stream_get_state(old_stream) == AST_STREAM_STATE_REMOVED || ast_stream_get_state(old_stream) == AST_STREAM_STATE_INACTIVE ||
+                               ast_stream_get_state(old_stream) == AST_STREAM_STATE_SENDONLY) &&
                                ast_stream_get_state(new_stream) != AST_STREAM_STATE_INACTIVE && ast_stream_get_state(new_stream) != AST_STREAM_STATE_SENDONLY &&
                                ast_stream_get_state(new_stream) != AST_STREAM_STATE_REMOVED) {
                        /* If a stream renegotiates and is added then we add it */