<p>Kevin Harwell has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.asterisk.org/5935">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">app_stream_echo: misc bug fixes<br><br>Fixed the following bugs:<br><br>* calls to stream_echo_write had the last two parameters swapped<br>* ast_read should have been ast_read_stream<br>* added a null check on the frame's subclass format<br><br>This also resets the update_sent flag upon receiving a control frame subclassed<br>with AST_CONTROL_DTLS_ESTABLISHED. This will then force a video update.<br><br>ASTERISK-26997<br><br>Change-Id: I6ad7c8253559b800800433c52339e7f5aa583566<br>---<br>M apps/app_stream_echo.c<br>1 file changed, 8 insertions(+), 7 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/35/5935/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">diff --git a/apps/app_stream_echo.c b/apps/app_stream_echo.c<br>index 79d1591..d6a5a8c 100644<br>--- a/apps/app_stream_echo.c<br>+++ b/apps/app_stream_echo.c<br>@@ -108,7 +108,6 @@<br>    * we simply want to echo it back out onto the same stream number.<br>     */<br>   num = ast_channel_is_multistream(chan) ? frame->stream_num : -1;<br>-<br>        if (ast_write_stream(chan, num, frame)) {<br>             return stream_echo_write_error(chan, frame, num);<br>     }<br>@@ -120,7 +119,8 @@<br>         * Note, if the channel is not multi-stream capable then one_to_one will<br>       * always be true, so it is safe to also not check for that here too.<br>          */<br>-  if (one_to_one || ast_format_get_type(frame->subclass.format) != type) {<br>+  if (one_to_one || !frame->subclass.format ||<br>+          ast_format_get_type(frame->subclass.format) != type) {<br>                 return 0;<br>     }<br> <br>@@ -141,7 +141,6 @@<br> <br>  for (i = 0; i < ast_stream_topology_get_count(topology); ++i) {<br>            struct ast_stream *stream = ast_stream_topology_get_stream(topology, i);<br>-<br>           if (num != i && ast_stream_get_type(stream) == type) {<br>                        if (ast_write_stream(chan, i, frame)) {<br>                               return stream_echo_write_error(chan, frame, i);<br>@@ -171,7 +170,7 @@<br>                  request_change = 0;<br>           }<br> <br>-         f = ast_read(chan);<br>+          f = ast_read_stream(chan);<br>            if (!f) {<br>                     return -1;<br>            }<br>@@ -186,11 +185,13 @@<br> <br>           if (f->frametype == AST_FRAME_CONTROL) {<br>                   if (f->subclass.integer == AST_CONTROL_VIDUPDATE && !update_sent) {<br>-                               if (stream_echo_write(chan, f, one_to_one, type)) {<br>+                          if (stream_echo_write(chan, f, type, one_to_one)) {<br>                                   ast_frfree(f);<br>                                        return -1;<br>                            }<br>                             update_sent = 1;<br>+                     } else if (f->subclass.integer == AST_CONTROL_DTLS_ESTABLISHED) {<br>+                         update_sent = 0;<br>                      } else if (f->subclass.integer == AST_CONTROL_STREAM_TOPOLOGY_CHANGED) {<br>                           update_sent = 0;<br>                              one_to_one = 0; /* Switch writing to one to many */<br>@@ -200,14 +201,14 @@<br>                            .frametype = AST_FRAME_CONTROL,<br>                               .subclass.integer = AST_CONTROL_VIDUPDATE,<br>                    };<br>-                   stream_echo_write(chan, &frame, one_to_one, type);<br>+                       stream_echo_write(chan, &frame, type, one_to_one);<br>                        update_sent = 1;<br>              }<br> <br>          if (f->frametype != AST_FRAME_CONTROL &&<br>               f->frametype != AST_FRAME_MODEM &&<br>                 f->frametype != AST_FRAME_NULL &&<br>-                 stream_echo_write(chan, f, one_to_one, type)) {<br>+              stream_echo_write(chan, f, type, one_to_one)) {<br>                   ast_frfree(f);<br>                        return -1;<br>            }<br></pre><p>To view, visit <a href="https://gerrit.asterisk.org/5935">change 5935</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/5935"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: asterisk </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-MessageType: newchange </div>
<div style="display:none"> Gerrit-Change-Id: I6ad7c8253559b800800433c52339e7f5aa583566 </div>
<div style="display:none"> Gerrit-Change-Number: 5935 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: Kevin Harwell <kharwell@digium.com> </div>