<p>Richard Mudgett has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.asterisk.org/7645">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">bridge_softmix.c: Change remove_destination_streams() return meaning.<br><br>The return value of remove_destination_streams() now means we removed a<br>stream from the topology by making it a dead stream.  Now we won't try to<br>request a topology change if we didn't remove any streams.<br><br>Change-Id: Icd91571d856a1d04299a24c411e325c1d9d5c61d<br>---<br>M bridges/bridge_softmix.c<br>1 file changed, 10 insertions(+), 4 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/45/7645/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">diff --git a/bridges/bridge_softmix.c b/bridges/bridge_softmix.c<br>index 8de88f2..7385736 100644<br>--- a/bridges/bridge_softmix.c<br>+++ b/bridges/bridge_softmix.c<br>@@ -697,10 +697,11 @@<br>         return 0;<br> }<br> <br>-static void remove_destination_streams(struct ast_stream_topology *topology,<br>+static int remove_destination_streams(struct ast_stream_topology *topology,<br>         const char *channel_name)<br> {<br>         int i;<br>+       int stream_removed = 0;<br> <br>    for (i = 0; i < ast_stream_topology_get_count(topology); ++i) {<br>            struct ast_stream *stream;<br>@@ -709,8 +710,10 @@<br> <br>           if (is_video_dest(stream, channel_name, NULL)) {<br>                      ast_stream_set_state(stream, AST_STREAM_STATE_REMOVED);<br>+                      stream_removed = 1;<br>           }<br>     }<br>+    return stream_removed;<br> }<br> <br> static int sfu_topologies_on_leave(struct ast_bridge_channel *leaver, struct ast_bridge_channels_list *participants)<br>@@ -720,13 +723,16 @@<br> <br>        AST_LIST_TRAVERSE(participants, participant, entry) {<br>                 sc = participant->tech_pvt;<br>-               remove_destination_streams(sc->topology, ast_channel_name(leaver->chan));<br>+              if (!remove_destination_streams(sc->topology, ast_channel_name(leaver->chan))) {<br>+                       continue;<br>+            }<br>             ast_channel_request_stream_topology_change(participant->chan, sc->topology, NULL);<br>      }<br> <br>  sc = leaver->tech_pvt;<br>-    remove_destination_streams(sc->topology, "");<br>-   ast_channel_request_stream_topology_change(leaver->chan, sc->topology, NULL);<br>+  if (remove_destination_streams(sc->topology, "")) {<br>+             ast_channel_request_stream_topology_change(leaver->chan, sc->topology, NULL);<br>+  }<br> <br>  return 0;<br> }<br></pre><p>To view, visit <a href="https://gerrit.asterisk.org/7645">change 7645</a>. To unsubscribe, visit <a href="https://gerrit.asterisk.org/settings">settings</a>.</p><div itemscope itemtype="http://schema.org/EmailMessage"><div itemscope itemprop="action" itemtype="http://schema.org/ViewAction"><link itemprop="url" href="https://gerrit.asterisk.org/7645"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: asterisk </div>
<div style="display:none"> Gerrit-Branch: 15 </div>
<div style="display:none"> Gerrit-MessageType: newchange </div>
<div style="display:none"> Gerrit-Change-Id: Icd91571d856a1d04299a24c411e325c1d9d5c61d </div>
<div style="display:none"> Gerrit-Change-Number: 7645 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: Richard Mudgett <rmudgett@digium.com> </div>