<html>
<body>
<div style="font-family: Verdana, Arial, Helvetica, Sans-Serif;">
<table bgcolor="#f9f3c9" width="100%" cellpadding="8" style="border: 1px #c9c399 solid;">
<tr>
<td>
This is an automatically generated e-mail. To reply, visit:
<a href="https://reviewboard.asterisk.org/r/3689/">https://reviewboard.asterisk.org/r/3689/</a>
</td>
</tr>
</table>
<br />
<pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">I did not look at any of chan_jingle, chan_h323, or chan_gtalk.</pre>
<br />
<div>
<table width="100%" border="0" bgcolor="white" style="border: 1px solid #C0C0C0; border-collapse: collapse; margin: 2px padding: 2px;">
<thead>
<tr>
<th colspan="4" bgcolor="#F0F0F0" style="border-bottom: 1px solid #C0C0C0; font-size: 9pt; padding: 4px 8px; text-align: left;">
<a href="https://reviewboard.asterisk.org/r/3689/diff/1/?file=61984#file61984line131" style="color: black; font-weight: bold; text-decoration: underline;">/team/group/media_formats-reviewed-trunk/include/asterisk/format_cap.h</a>
<span style="font-weight: normal;">
(Diff revision 1)
</span>
</th>
</tr>
</thead>
<tbody style="background-color: #e4d9cb; padding: 4px 8px; text-align: center;">
<tr>
<td colspan="2"><pre style="font-size: 8pt; line-height: 140%; margin: 0; ">int ast_format_cap_add_all_by_type(struct ast_format_cap *cap, enum ast_media_type type);</pre></td>
<td colspan="2"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "></pre></td>
</tr>
</tbody>
<tbody>
<tr>
<th bgcolor="#e9eaa8" style="border-right: 1px solid #C0C0C0;" align="right"><font size="2">109</font></th>
<td bgcolor="#fdfebc" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "><span class="kt">int</span> <span class="nf">ast_format_cap_a<span class="hl">d</span>d_all_by_type</span><span class="p">(</span><span class="k">struct</span> <span class="n">ast_format_cap</span> <span class="o">*</span><span class="n">cap</span><span class="p">,</span> <span class="k">enum</span> <span class="n">ast_media_type</span> <span class="n">type</span><span class="p">);</span></pre></td>
<th bgcolor="#e9eaa8" style="border-left: 1px solid #C0C0C0; border-right: 1px solid #C0C0C0;" align="right"><font size="2">131</font></th>
<td bgcolor="#fdfebc" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "><span class="kt">int</span> <span class="nf">ast_format_cap_a<span class="hl">ppen</span>d_all_by_type</span><span class="p">(</span><span class="k">struct</span> <span class="n">ast_format_cap</span> <span class="o">*</span><span class="n">cap</span><span class="p">,</span> <span class="k">enum</span> <span class="n">ast_media_type</span> <span class="n">type</span><span class="p">);</span></pre></td>
</tr>
</tbody>
</table>
<pre style="margin-left: 2em; white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">I think this procedure should be named ast_format_cap_append_by_type, to be the reverse of ast_format_cap_remove_by_type.
The current ast_format_cap_add_by_type could be named ast_format_cap_append_cap_by_type? In any case I think that should have the longer name since it's a more specific action.
Sorry I didn't pick this up during the original email exchange.</pre>
</div>
<br />
<div>
<table width="100%" border="0" bgcolor="white" style="border: 1px solid #C0C0C0; border-collapse: collapse; margin: 2px padding: 2px;">
<thead>
<tr>
<th colspan="4" bgcolor="#F0F0F0" style="border-bottom: 1px solid #C0C0C0; font-size: 9pt; padding: 4px 8px; text-align: left;">
<a href="https://reviewboard.asterisk.org/r/3689/diff/1/?file=61986#file61986line180" style="color: black; font-weight: bold; text-decoration: underline;">/team/group/media_formats-reviewed-trunk/include/asterisk/frame.h</a>
<span style="font-weight: normal;">
(Diff revision 1)
</span>
</th>
</tr>
</thead>
<tbody style="background-color: #e4d9cb; padding: 4px 8px; text-align: center;">
<tr>
<td colspan="4"><pre style="font-size: 8pt; line-height: 140%; margin: 0; ">struct ast_frame {</pre></td>
</tr>
</tbody>
<tbody>
<tr>
<th bgcolor="#b1ebb0" style="border-right: 1px solid #C0C0C0;" align="right"><font size="2"></font></th>
<td bgcolor="#c5ffc4" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "></pre></td>
<th bgcolor="#b1ebb0" style="border-left: 1px solid #C0C0C0; border-right: 1px solid #C0C0C0;" align="right"><font size="2">180</font></th>
<td bgcolor="#c5ffc4" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "><span class="tb"> </span><span class="cm">/*! Format of the frame. */</span></pre></td>
</tr>
<tr>
<th bgcolor="#b1ebb0" style="border-right: 1px solid #C0C0C0;" align="right"><font size="2"></font></th>
<td bgcolor="#c5ffc4" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "></pre></td>
<th bgcolor="#b1ebb0" style="border-left: 1px solid #C0C0C0; border-right: 1px solid #C0C0C0;" align="right"><font size="2">181</font></th>
<td bgcolor="#c5ffc4" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "><span class="tb"> </span><span class="k">struct</span> <span class="n">ast_format</span> <span class="o">*</span><span class="n">format</span><span class="p">;</span></pre></td>
</tr>
</tbody>
</table>
<pre style="margin-left: 2em; white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">This looks like temporary code I was considering that should not be done now. The idea was to move format from subclass, forcing a full system audit of references to the frames format.</pre>
</div>
<br />
<div>
<table width="100%" border="0" bgcolor="white" style="border: 1px solid #C0C0C0; border-collapse: collapse; margin: 2px padding: 2px;">
<thead>
<tr>
<th colspan="4" bgcolor="#F0F0F0" style="border-bottom: 1px solid #C0C0C0; font-size: 9pt; padding: 4px 8px; text-align: left;">
<a href="https://reviewboard.asterisk.org/r/3689/diff/1/?file=61989#file61989line78" style="color: black; font-weight: bold; text-decoration: underline;">/team/group/media_formats-reviewed-trunk/main/astobj2_container.c</a>
<span style="font-weight: normal;">
(Diff revision 1)
</span>
</th>
</tr>
</thead>
<tbody style="background-color: #e4d9cb; padding: 4px 8px; text-align: center;">
<tr>
<td colspan="4"><pre style="font-size: 8pt; line-height: 140%; margin: 0; ">int __container_unlink_node_debug(struct ao2_container_node *node, uint32_t flags,</pre></td>
</tr>
</tbody>
<tbody>
<tr>
<th bgcolor="#e9eaa8" style="border-right: 1px solid #C0C0C0;" align="right"><font size="2">78</font></th>
<td bgcolor="#fdfebc" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "><span class="tb"> </span><span class="tb"> </span><span class="n">ao2_t_ref</span><span class="p">(</span><span class="n">node</span><span class="p">,</span> <span class="o">-</span><span class="mi">1</span><span class="p">,</span> <span class="s">"Remove node from container"</span><span class="p">);</span></pre></td>
<th bgcolor="#e9eaa8" style="border-left: 1px solid #C0C0C0; border-right: 1px solid #C0C0C0;" align="right"><font size="2">78</font></th>
<td bgcolor="#fdfebc" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "><span class="tb"> </span><span class="tb"> </span><span class="n">__ao2_ref</span><span class="p">(</span><span class="n">node</span><span class="p">,</span> <span class="o">-</span><span class="mi">1</span><span class="p">);</span></pre></td>
</tr>
</tbody>
</table>
<pre style="margin-left: 2em; white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">I feel about this the same as I do the astobj2.c change. I think merges from trunk should be done in commits separate from actual media_formats work. I think immediately after this change is committed would be a good time to update from trunk. We can include r3698 in that merge.</pre>
</div>
<br />
<div>
<table width="100%" border="0" bgcolor="white" style="border: 1px solid #C0C0C0; border-collapse: collapse; margin: 2px padding: 2px;">
<thead>
<tr>
<th colspan="4" bgcolor="#F0F0F0" style="border-bottom: 1px solid #C0C0C0; font-size: 9pt; padding: 4px 8px; text-align: left;">
<a href="https://reviewboard.asterisk.org/r/3689/diff/1/?file=61990#file61990line940" style="color: black; font-weight: bold; text-decoration: underline;">/team/group/media_formats-reviewed-trunk/main/bridge.c</a>
<span style="font-weight: normal;">
(Diff revision 1)
</span>
</th>
</tr>
</thead>
<tbody style="background-color: #e4d9cb; padding: 4px 8px; text-align: center;">
<tr>
<td colspan="4"><pre style="font-size: 8pt; line-height: 140%; margin: 0; ">int ast_bridge_destroy(struct ast_bridge *bridge, int cause)</pre></td>
</tr>
</tbody>
<tbody>
<tr>
<th bgcolor="#ebb1ba" style="border-right: 1px solid #C0C0C0;" align="right"><font size="2">940</font></th>
<td bgcolor="#ffc5ce" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "><span class="tb"> </span><span class="kt">char</span> <span class="n">codec_buf</span><span class="p">[</span><span class="mi">512</span><span class="p">];</span></pre></td>
<th bgcolor="#ebb1ba" style="border-left: 1px solid #C0C0C0; border-right: 1px solid #C0C0C0;" align="right"><font size="2"></font></th>
<td bgcolor="#ffc5ce" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "></pre></td>
</tr>
</tbody>
</table>
<pre style="margin-left: 2em; white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">I think ast_str should be ast_str_alloca'ed from here once instead of twice.</pre>
</div>
<br />
<div>
<table width="100%" border="0" bgcolor="white" style="border: 1px solid #C0C0C0; border-collapse: collapse; margin: 2px padding: 2px;">
<thead>
<tr>
<th colspan="4" bgcolor="#F0F0F0" style="border-bottom: 1px solid #C0C0C0; font-size: 9pt; padding: 4px 8px; text-align: left;">
<a href="https://reviewboard.asterisk.org/r/3689/diff/1/?file=62000#file62000line475" style="color: black; font-weight: bold; text-decoration: underline;">/team/group/media_formats-reviewed-trunk/main/format_cache.c</a>
<span style="font-weight: normal;">
(Diff revision 1)
</span>
</th>
</tr>
</thead>
<tbody>
<tr>
<th bgcolor="#b1ebb0" style="border-right: 1px solid #C0C0C0;" align="right"><font size="2"></font></th>
<td bgcolor="#c5ffc4" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "></pre></td>
<th bgcolor="#b1ebb0" style="border-left: 1px solid #C0C0C0; border-right: 1px solid #C0C0C0;" align="right"><font size="2">475</font></th>
<td bgcolor="#c5ffc4" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "><span class="tb"> </span><span class="k">return</span> <span class="n">__ao2_find_debug</span><span class="p">(</span><span class="n">formats</span><span class="p">,</span> <span class="n">name</span><span class="p">,</span> <span class="n">OBJ_SEARCH_KEY</span><span class="p">,</span> <span class="s">"ast_format_cache_get"</span><span class="p">,</span> <span class="n">file</span><span class="p">,</span> <span class="n">line</span><span class="p">,</span> <span class="n">func</span><span class="p">);</span></pre></td>
</tr>
</tbody>
</table>
<pre style="margin-left: 2em; white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">As with other REF_DEBUG functions I feel we should accept a tag parameter, use S_OR. </pre>
</div>
<br />
<div>
<table width="100%" border="0" bgcolor="white" style="border: 1px solid #C0C0C0; border-collapse: collapse; margin: 2px padding: 2px;">
<thead>
<tr>
<th colspan="4" bgcolor="#F0F0F0" style="border-bottom: 1px solid #C0C0C0; font-size: 9pt; padding: 4px 8px; text-align: left;">
<a href="https://reviewboard.asterisk.org/r/3689/diff/1/?file=62001#file62001line119" style="color: black; font-weight: bold; text-decoration: underline;">/team/group/media_formats-reviewed-trunk/main/format_cap.c</a>
<span style="font-weight: normal;">
(Diff revision 1)
</span>
</th>
</tr>
</thead>
<tbody>
<tr>
<th bgcolor="#b1ebb0" style="border-right: 1px solid #C0C0C0;" align="right"><font size="2"></font></th>
<td bgcolor="#c5ffc4" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "></pre></td>
<th bgcolor="#b1ebb0" style="border-left: 1px solid #C0C0C0; border-right: 1px solid #C0C0C0;" align="right"><font size="2">119</font></th>
<td bgcolor="#c5ffc4" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "><span class="tb"> </span><span class="n">cap</span> <span class="o">=</span> <span class="n">__ao2_alloc_debug</span><span class="p">(</span><span class="k">sizeof</span><span class="p">(</span><span class="o">*</span><span class="n">cap</span><span class="p">),</span> <span class="n">format_cap_destroy</span><span class="p">,</span> <span class="n">AO2_ALLOC_OPT_LOCK_NOLOCK</span><span class="p">,</span> <span class="s">"ast_format_cap_alloc"</span><span class="p">,</span> <span class="n">file</span><span class="p">,</span> <span class="n">line</span><span class="p">,</span> <span class="n">func</span><span class="p">,</span> <span class="mi">1</span><span class="p">);</span></pre></td>
</tr>
</tbody>
</table>
<pre style="margin-left: 2em; white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">This procedure accepts tag, so it should be passed to __ao2_alloc_debug. Maybe S_OR(tag, "ast_format_cap_alloc") would be better?</pre>
</div>
<br />
<div>
<table width="100%" border="0" bgcolor="white" style="border: 1px solid #C0C0C0; border-collapse: collapse; margin: 2px padding: 2px;">
<thead>
<tr>
<th colspan="4" bgcolor="#F0F0F0" style="border-bottom: 1px solid #C0C0C0; font-size: 9pt; padding: 4px 8px; text-align: left;">
<a href="https://reviewboard.asterisk.org/r/3689/diff/1/?file=62001#file62001line124" style="color: black; font-weight: bold; text-decoration: underline;">/team/group/media_formats-reviewed-trunk/main/format_cap.c</a>
<span style="font-weight: normal;">
(Diff revision 1)
</span>
</th>
</tr>
</thead>
<tbody>
<tr>
<th bgcolor="#b1ebb0" style="border-right: 1px solid #C0C0C0;" align="right"><font size="2"></font></th>
<td bgcolor="#c5ffc4" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "></pre></td>
<th bgcolor="#b1ebb0" style="border-left: 1px solid #C0C0C0; border-right: 1px solid #C0C0C0;" align="right"><font size="2">124</font></th>
<td bgcolor="#c5ffc4" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "><span class="tb"> </span><span class="n">AST_VECTOR_INIT</span><span class="p">(</span><span class="o">&</span><span class="n">cap</span><span class="o">-></span><span class="n">formats</span><span class="p">,</span> <span class="mi">0</span><span class="p">);</span></pre></td>
</tr>
<tr>
<th bgcolor="#b1ebb0" style="border-right: 1px solid #C0C0C0;" align="right"><font size="2"></font></th>
<td bgcolor="#c5ffc4" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "></pre></td>
<th bgcolor="#b1ebb0" style="border-left: 1px solid #C0C0C0; border-right: 1px solid #C0C0C0;" align="right"><font size="2">125</font></th>
<td bgcolor="#c5ffc4" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "></pre></td>
</tr>
<tr>
<th bgcolor="#b1ebb0" style="border-right: 1px solid #C0C0C0;" align="right"><font size="2"></font></th>
<td bgcolor="#c5ffc4" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "></pre></td>
<th bgcolor="#b1ebb0" style="border-left: 1px solid #C0C0C0; border-right: 1px solid #C0C0C0;" align="right"><font size="2">126</font></th>
<td bgcolor="#c5ffc4" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "><span class="tb"> </span><span class="cm">/* </span><span class="cs">TODO</span><span class="cm">: Look at common usage of this and determine a good starting point */</span></pre></td>
</tr>
<tr>
<th bgcolor="#b1ebb0" style="border-right: 1px solid #C0C0C0;" align="right"><font size="2"></font></th>
<td bgcolor="#c5ffc4" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "></pre></td>
<th bgcolor="#b1ebb0" style="border-left: 1px solid #C0C0C0; border-right: 1px solid #C0C0C0;" align="right"><font size="2">127</font></th>
<td bgcolor="#c5ffc4" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "><span class="tb"> </span><span class="n">AST_VECTOR_INIT</span><span class="p">(</span><span class="o">&</span><span class="n">cap</span><span class="o">-></span><span class="n">preference_order</span><span class="p">,</span> <span class="mi">5</span><span class="p">);</span></pre></td>
</tr>
<tr>
<th bgcolor="#b1ebb0" style="border-right: 1px solid #C0C0C0;" align="right"><font size="2"></font></th>
<td bgcolor="#c5ffc4" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "></pre></td>
<th bgcolor="#b1ebb0" style="border-left: 1px solid #C0C0C0; border-right: 1px solid #C0C0C0;" align="right"><font size="2">128</font></th>
<td bgcolor="#c5ffc4" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "></pre></td>
</tr>
<tr>
<th bgcolor="#b1ebb0" style="border-right: 1px solid #C0C0C0;" align="right"><font size="2"></font></th>
<td bgcolor="#c5ffc4" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "></pre></td>
<th bgcolor="#b1ebb0" style="border-left: 1px solid #C0C0C0; border-right: 1px solid #C0C0C0;" align="right"><font size="2">129</font></th>
<td bgcolor="#c5ffc4" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "><span class="tb"> </span><span class="n">cap</span><span class="o">-></span><span class="n">framing</span> <span class="o">=</span> <span class="n">UINT_MAX</span><span class="p">;</span></pre></td>
</tr>
<tr>
<th bgcolor="#b1ebb0" style="border-right: 1px solid #C0C0C0;" align="right"><font size="2"></font></th>
<td bgcolor="#c5ffc4" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "></pre></td>
<th bgcolor="#b1ebb0" style="border-left: 1px solid #C0C0C0; border-right: 1px solid #C0C0C0;" align="right"><font size="2">130</font></th>
<td bgcolor="#c5ffc4" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "></pre></td>
</tr>
<tr>
<th bgcolor="#b1ebb0" style="border-right: 1px solid #C0C0C0;" align="right"><font size="2"></font></th>
<td bgcolor="#c5ffc4" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "></pre></td>
<th bgcolor="#b1ebb0" style="border-left: 1px solid #C0C0C0; border-right: 1px solid #C0C0C0;" align="right"><font size="2">131</font></th>
<td bgcolor="#c5ffc4" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "><span class="tb"> </span><span class="k">return</span> <span class="n">cap</span><span class="p">;</span></pre></td>
</tr>
</tbody>
</table>
<pre style="margin-left: 2em; white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">I'm against duplicating code. I'd much rather this be moved to a static (inline?) function.</pre>
</div>
<br />
<div>
<table width="100%" border="0" bgcolor="white" style="border: 1px solid #C0C0C0; border-collapse: collapse; margin: 2px padding: 2px;">
<thead>
<tr>
<th colspan="4" bgcolor="#F0F0F0" style="border-bottom: 1px solid #C0C0C0; font-size: 9pt; padding: 4px 8px; text-align: left;">
<a href="https://reviewboard.asterisk.org/r/3689/diff/1/?file=62001#file62001line185" style="color: black; font-weight: bold; text-decoration: underline;">/team/group/media_formats-reviewed-trunk/main/format_cap.c</a>
<span style="font-weight: normal;">
(Diff revision 1)
</span>
</th>
</tr>
</thead>
<tbody style="background-color: #e4d9cb; padding: 4px 8px; text-align: center;">
<tr>
<td colspan="2"><pre style="font-size: 8pt; line-height: 140%; margin: 0; ">int ast_format_cap_add(struct ast_format_cap *cap, struct ast_format *format, unsigned int framing)</pre></td>
<td colspan="2"><pre style="font-size: 8pt; line-height: 140%; margin: 0; ">int __ast_format_cap_append(struct ast_format_cap *cap, struct ast_format *format, unsigned int framing)</pre></td>
</tr>
</tbody>
<tbody>
<tr>
<th bgcolor="#b1ebb0" style="border-right: 1px solid #C0C0C0;" align="right"><font size="2"></font></th>
<td bgcolor="#c5ffc4" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "></pre></td>
<th bgcolor="#b1ebb0" style="border-left: 1px solid #C0C0C0; border-right: 1px solid #C0C0C0;" align="right"><font size="2">185</font></th>
<td bgcolor="#c5ffc4" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "><span class="tb"> </span><span class="n">framed</span> <span class="o">=</span> <span class="n">__ao2_alloc_debug</span><span class="p">(</span><span class="k">sizeof</span><span class="p">(</span><span class="o">*</span><span class="n">framed</span><span class="p">),</span> <span class="n">format_cap_framed_destroy</span><span class="p">,</span> <span class="n">AO2_ALLOC_OPT_LOCK_NOLOCK</span><span class="p">,</span> <span class="s">"ast_format_cap_append"</span><span class="p">,</span> <span class="n">file</span><span class="p">,</span> <span class="n">line</span><span class="p">,</span> <span class="n">func</span><span class="p">,</span> <span class="mi">1</span><span class="p">);</span></pre></td>
</tr>
</tbody>
</table>
<pre style="margin-left: 2em; white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">Do we want to debug this? framed seems like it belongs to format_cap.c. I think maybe just ao2_t_alloc to pass the tag but use format_cap.c:185 as the file:line. Additionally use ao2_ref for other manipulations of framed.</pre>
</div>
<br />
<div>
<table width="100%" border="0" bgcolor="white" style="border: 1px solid #C0C0C0; border-collapse: collapse; margin: 2px padding: 2px;">
<thead>
<tr>
<th colspan="4" bgcolor="#F0F0F0" style="border-bottom: 1px solid #C0C0C0; font-size: 9pt; padding: 4px 8px; text-align: left;">
<a href="https://reviewboard.asterisk.org/r/3689/diff/1/?file=62001#file62001line190" style="color: black; font-weight: bold; text-decoration: underline;">/team/group/media_formats-reviewed-trunk/main/format_cap.c</a>
<span style="font-weight: normal;">
(Diff revision 1)
</span>
</th>
</tr>
</thead>
<tbody style="background-color: #e4d9cb; padding: 4px 8px; text-align: center;">
<tr>
<td colspan="2"><pre style="font-size: 8pt; line-height: 140%; margin: 0; ">int ast_format_cap_add(struct ast_format_cap *cap, struct ast_format *format, unsigned int framing)</pre></td>
<td colspan="2"><pre style="font-size: 8pt; line-height: 140%; margin: 0; ">int __ast_format_cap_append(struct ast_format_cap *cap, struct ast_format *format, unsigned int framing)</pre></td>
</tr>
</tbody>
<tbody>
<tr>
<th bgcolor="#b1ebb0" style="border-right: 1px solid #C0C0C0;" align="right"><font size="2"></font></th>
<td bgcolor="#c5ffc4" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "></pre></td>
<th bgcolor="#b1ebb0" style="border-left: 1px solid #C0C0C0; border-right: 1px solid #C0C0C0;" align="right"><font size="2">190</font></th>
<td bgcolor="#c5ffc4" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "><span class="tb"> </span><span class="n">__ao2_ref_debug</span><span class="p">(</span><span class="n">format</span><span class="p">,</span> <span class="o">+</span><span class="mi">1</span><span class="p">,</span> <span class="s">"ast_format_cap_append"</span><span class="p">,</span> <span class="n">file</span><span class="p">,</span> <span class="n">line</span><span class="p">,</span> <span class="n">func</span><span class="p">);</span></pre></td>
</tr>
</tbody>
</table>
<pre style="margin-left: 2em; white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">Please S_OR for tag</pre>
</div>
<br />
<div>
<table width="100%" border="0" bgcolor="white" style="border: 1px solid #C0C0C0; border-collapse: collapse; margin: 2px padding: 2px;">
<thead>
<tr>
<th colspan="4" bgcolor="#F0F0F0" style="border-bottom: 1px solid #C0C0C0; font-size: 9pt; padding: 4px 8px; text-align: left;">
<a href="https://reviewboard.asterisk.org/r/3689/diff/1/?file=62001#file62001line203" style="color: black; font-weight: bold; text-decoration: underline;">/team/group/media_formats-reviewed-trunk/main/format_cap.c</a>
<span style="font-weight: normal;">
(Diff revision 1)
</span>
</th>
</tr>
</thead>
<tbody style="background-color: #e4d9cb; padding: 4px 8px; text-align: center;">
<tr>
<td colspan="2"><pre style="font-size: 8pt; line-height: 140%; margin: 0; ">int ast_format_cap_add(struct ast_format_cap *cap, struct ast_format *format, unsigned int framing)</pre></td>
<td colspan="2"><pre style="font-size: 8pt; line-height: 140%; margin: 0; ">int __ast_format_cap_append(struct ast_format_cap *cap, struct ast_format *format, unsigned int framing)</pre></td>
</tr>
</tbody>
<tbody>
<tr>
<th bgcolor="#b1ebb0" style="border-right: 1px solid #C0C0C0;" align="right"><font size="2"></font></th>
<td bgcolor="#c5ffc4" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "></pre></td>
<th bgcolor="#b1ebb0" style="border-left: 1px solid #C0C0C0; border-right: 1px solid #C0C0C0;" align="right"><font size="2">203</font></th>
<td bgcolor="#c5ffc4" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "><span class="tb"> </span><span class="n">ao2_ref</span><span class="p">(</span><span class="n">framed</span><span class="p">,</span> <span class="o">+</span><span class="mi">1</span><span class="p">);</span></pre></td>
</tr>
</tbody>
</table>
<pre style="margin-left: 2em; white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">I think this ref is leaked. You don't need a new reference, we already have one from the framed = ao2_alloc.
Original (non-debug) procedure contains this error as well. Again I'm against duplication of code, I think most of this should be moved to a function shared by the debug and non-debug versions.</pre>
</div>
<br />
<div>
<table width="100%" border="0" bgcolor="white" style="border: 1px solid #C0C0C0; border-collapse: collapse; margin: 2px padding: 2px;">
<thead>
<tr>
<th colspan="4" bgcolor="#F0F0F0" style="border-bottom: 1px solid #C0C0C0; font-size: 9pt; padding: 4px 8px; text-align: left;">
<a href="https://reviewboard.asterisk.org/r/3689/diff/1/?file=62001#file62001line670" style="color: black; font-weight: bold; text-decoration: underline;">/team/group/media_formats-reviewed-trunk/main/format_cap.c</a>
<span style="font-weight: normal;">
(Diff revision 1)
</span>
</th>
</tr>
</thead>
<tbody style="background-color: #e4d9cb; padding: 4px 8px; text-align: center;">
<tr>
<td colspan="4"><pre style="font-size: 8pt; line-height: 140%; margin: 0; ">int ast_format_cap_identical(const struct ast_format_cap *cap1, const struct ast_format_cap *cap2)</pre></td>
</tr>
</tbody>
<tbody>
<tr>
<th bgcolor="#e9eaa8" style="border-right: 1px solid #C0C0C0;" align="right"><font size="2">559</font></th>
<td bgcolor="#fdfebc" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "><span class="tb"> </span><span class="tb"> </span><span class="k">if</span> <span class="p">(</span><span class="n">cap</span><span class="p">)</span> <span class="p">{</span></pre></td>
<th bgcolor="#e9eaa8" style="border-left: 1px solid #C0C0C0; border-right: 1px solid #C0C0C0;" align="right"><font size="2">618</font></th>
<td bgcolor="#fdfebc" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "><span class="tb"> </span><span class="tb"> </span><span class="n">ast_str_append</span><span class="p">(</span><span class="n">buf</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span> <span class="s">"%s%s"</span><span class="p">,</span> <span class="n">ast_format_get_name</span><span class="p">(</span><span class="n">framed</span><span class="o">-></span><span class="n">format</span><span class="p">),</span></pre></td>
</tr>
</tbody>
</table>
<pre style="margin-left: 2em; white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">Maybe check if we've reached buf's limit? Since most calls to this procedure use ast_str_alloca we could escape early if we're already full. I feel like we should still return the string. Assume that any caller which requires complete output will provide a malloc'ed ast_str or an alloca'ed one that is large enough.</pre>
</div>
<br />
<p>- Corey Farrell</p>
<br />
<p>On July 1st, 2014, 10:53 p.m. EDT, Matt Jordan wrote:</p>
<table bgcolor="#fefadf" width="100%" cellspacing="0" cellpadding="8" style="background-image: url('https://reviewboard.asterisk.org/static/rb/images/review_request_box_top_bg.ab6f3b1072c9.png'); background-position: left top; background-repeat: repeat-x; border: 1px black solid;">
<tr>
<td>
<div>Review request for Asterisk Developers.</div>
<div>By Matt Jordan.</div>
<p style="color: grey;"><i>Updated July 1, 2014, 10:53 p.m.</i></p>
<div style="margin-top: 1.5em;">
<b style="color: #575012; font-size: 10pt;">Repository: </b>
Asterisk
</div>
<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Description </h1>
<table width="100%" bgcolor="#ffffff" cellspacing="0" cellpadding="10" style="border: 1px solid #b8b5a0">
<tr>
<td>
<pre style="margin: 0; padding: 0; white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">This patch performs the renaming discussed on the asterisk-dev list [1]. As usual, as I was going through it some other cleanups occurred, and in order to make sure I didn't make memory leaks worse, some parts of Corey's memory leak cleanups made their way in as well.
[1] http://lists.digium.com/pipermail/asterisk-dev/2014-June/068133.html
The great renaming:
* ast_format_cap_add => ast_format_cap_append
* ast_format_cap_add_all_by_type => ast_format_cap_append_all_by_type
* ast_parse_allow_disallow => ast_format_cap_update_by_allow_disallow
* ast_cap_remove_bytype => ast_format_cap_remove_by_type
* ast_getformatname_multiple => ast_format_cap_get_names, and now uses an ast_str ** instead of a char *buf/size_t len
* ast_format_sdp_generate => ast_format_generate_sdp_fmtp
* ast_format_sdp_parse => ast_format_parse_sdp_fmtp
Functions removed:
* ast_format_compatibility_get_original_id - no longer used
Note that chan_h323, chan_gtalk, and chan_jingle did not get all of the re-namings (particularly ast_getformatname_multiple => ast_format_cap_get_names), and will not compile with this patch. These modules should be removed, per the discussion on the -dev list.
Functions that support REF_DEBUG:
* ast_format_cap_alloc
* ast_format_cap_append
* ast_format_cache_get
Memory leak cleanups (many of which came from Corey's patches):
* Channel technology struct capabilities leak their format capabilities on off nominal exit paths (chan_motif, chan_pjsip, chan_unistim, chan_skinny)
* Format capabilities leak in chan_pjsip_new nominal path
* Leak of nativeformats format_cap in nominal path of channel.c's ast_channel_alloc
* Leak of format_cap in channel.c's set_format
* Leak of format_cap in channel.c's ast_request
* Usage of ao2_replace in translate.c to avoid overwriting a ref
* Clean up of frame format cache in RTP instance in res_rtp_asterisk destructor
Unit tests
* Remove test for ast_getformatname_multiple, add test for ast_format_cap_get_names
</pre>
</td>
</tr>
</table>
<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Testing </h1>
<table width="100%" bgcolor="#ffffff" cellspacing="0" cellpadding="10" style="border: 1px solid #b8b5a0">
<tr>
<td>
<pre style="margin: 0; padding: 0; white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">Negotiation using PJSIP still works.
The most prevalent memory leak that still occurs happens when a statically allocated frame ref bumps a format. This happens a lot when generating translator tables, and in various other places as well.</pre>
</td>
</tr>
</table>
<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Diffs</b> </h1>
<ul style="margin-left: 3em; padding-left: 0;">
<li>/team/group/media_formats-reviewed-trunk/tests/test_voicemail_api.c <span style="color: grey">(417740)</span></li>
<li>/team/group/media_formats-reviewed-trunk/tests/test_format_cap.c <span style="color: grey">(417740)</span></li>
<li>/team/group/media_formats-reviewed-trunk/tests/test_format_api.c <span style="color: grey">(417740)</span></li>
<li>/team/group/media_formats-reviewed-trunk/tests/test_core_format.c <span style="color: grey">(417740)</span></li>
<li>/team/group/media_formats-reviewed-trunk/tests/test_config.c <span style="color: grey">(417740)</span></li>
<li>/team/group/media_formats-reviewed-trunk/res/res_stasis_snoop.c <span style="color: grey">(417740)</span></li>
<li>/team/group/media_formats-reviewed-trunk/res/res_stasis.c <span style="color: grey">(417740)</span></li>
<li>/team/group/media_formats-reviewed-trunk/res/res_rtp_asterisk.c <span style="color: grey">(417740)</span></li>
<li>/team/group/media_formats-reviewed-trunk/res/res_pjsip_sdp_rtp.c <span style="color: grey">(417740)</span></li>
<li>/team/group/media_formats-reviewed-trunk/res/res_pjsip/pjsip_configuration.c <span style="color: grey">(417740)</span></li>
<li>/team/group/media_formats-reviewed-trunk/res/res_clioriginate.c <span style="color: grey">(417740)</span></li>
<li>/team/group/media_formats-reviewed-trunk/res/res_calendar.c <span style="color: grey">(417740)</span></li>
<li>/team/group/media_formats-reviewed-trunk/res/res_agi.c <span style="color: grey">(417740)</span></li>
<li>/team/group/media_formats-reviewed-trunk/res/parking/parking_applications.c <span style="color: grey">(417740)</span></li>
<li>/team/group/media_formats-reviewed-trunk/res/ari/resource_channels.c <span style="color: grey">(417740)</span></li>
<li>/team/group/media_formats-reviewed-trunk/res/ari/resource_bridges.c <span style="color: grey">(417740)</span></li>
<li>/team/group/media_formats-reviewed-trunk/pbx/pbx_spool.c <span style="color: grey">(417740)</span></li>
<li>/team/group/media_formats-reviewed-trunk/main/translate.c <span style="color: grey">(417740)</span></li>
<li>/team/group/media_formats-reviewed-trunk/main/sorcery.c <span style="color: grey">(417740)</span></li>
<li>/team/group/media_formats-reviewed-trunk/main/rtp_engine.c <span style="color: grey">(417740)</span></li>
<li>/team/group/media_formats-reviewed-trunk/main/media_index.c <span style="color: grey">(417740)</span></li>
<li>/team/group/media_formats-reviewed-trunk/main/manager.c <span style="color: grey">(417740)</span></li>
<li>/team/group/media_formats-reviewed-trunk/main/frame.c <span style="color: grey">(417740)</span></li>
<li>/team/group/media_formats-reviewed-trunk/main/format_compatibility.c <span style="color: grey">(417740)</span></li>
<li>/team/group/media_formats-reviewed-trunk/main/format_cap.c <span style="color: grey">(417740)</span></li>
<li>/team/group/media_formats-reviewed-trunk/main/format_cache.c <span style="color: grey">(417740)</span></li>
<li>/team/group/media_formats-reviewed-trunk/main/format.c <span style="color: grey">(417740)</span></li>
<li>/team/group/media_formats-reviewed-trunk/main/file.c <span style="color: grey">(417740)</span></li>
<li>/team/group/media_formats-reviewed-trunk/main/dial.c <span style="color: grey">(417740)</span></li>
<li>/team/group/media_formats-reviewed-trunk/main/core_local.c <span style="color: grey">(417740)</span></li>
<li>/team/group/media_formats-reviewed-trunk/main/config_options.c <span style="color: grey">(417740)</span></li>
<li>/team/group/media_formats-reviewed-trunk/main/cli.c <span style="color: grey">(417740)</span></li>
<li>/team/group/media_formats-reviewed-trunk/main/channel.c <span style="color: grey">(417740)</span></li>
<li>/team/group/media_formats-reviewed-trunk/main/ccss.c <span style="color: grey">(417740)</span></li>
<li>/team/group/media_formats-reviewed-trunk/main/bridge_basic.c <span style="color: grey">(417740)</span></li>
<li>/team/group/media_formats-reviewed-trunk/main/bridge.c <span style="color: grey">(417740)</span></li>
<li>/team/group/media_formats-reviewed-trunk/main/astobj2_container.c <span style="color: grey">(417740)</span></li>
<li>/team/group/media_formats-reviewed-trunk/include/asterisk/slin.h <span style="color: grey">(417740)</span></li>
<li>/team/group/media_formats-reviewed-trunk/include/asterisk/rtp_engine.h <span style="color: grey">(417740)</span></li>
<li>/team/group/media_formats-reviewed-trunk/include/asterisk/frame.h <span style="color: grey">(417740)</span></li>
<li>/team/group/media_formats-reviewed-trunk/include/asterisk/format_compatibility.h <span style="color: grey">(417740)</span></li>
<li>/team/group/media_formats-reviewed-trunk/include/asterisk/format_cap.h <span style="color: grey">(417740)</span></li>
<li>/team/group/media_formats-reviewed-trunk/include/asterisk/format_cache.h <span style="color: grey">(417740)</span></li>
<li>/team/group/media_formats-reviewed-trunk/include/asterisk/format.h <span style="color: grey">(417740)</span></li>
<li>/team/group/media_formats-reviewed-trunk/funcs/func_channel.c <span style="color: grey">(417740)</span></li>
<li>/team/group/media_formats-reviewed-trunk/codecs/ex_ulaw.h <span style="color: grey">(417740)</span></li>
<li>/team/group/media_formats-reviewed-trunk/codecs/ex_gsm.h <span style="color: grey">(417740)</span></li>
<li>/team/group/media_formats-reviewed-trunk/codecs/ex_alaw.h <span style="color: grey">(417740)</span></li>
<li>/team/group/media_formats-reviewed-trunk/codecs/ex_adpcm.h <span style="color: grey">(417740)</span></li>
<li>/team/group/media_formats-reviewed-trunk/channels/pjsip/dialplan_functions.c <span style="color: grey">(417740)</span></li>
<li>/team/group/media_formats-reviewed-trunk/channels/dahdi/bridge_native_dahdi.c <span style="color: grey">(417740)</span></li>
<li>/team/group/media_formats-reviewed-trunk/channels/chan_unistim.c <span style="color: grey">(417740)</span></li>
<li>/team/group/media_formats-reviewed-trunk/channels/chan_skinny.c <span style="color: grey">(417740)</span></li>
<li>/team/group/media_formats-reviewed-trunk/channels/chan_sip.c <span style="color: grey">(417740)</span></li>
<li>/team/group/media_formats-reviewed-trunk/channels/chan_pjsip.c <span style="color: grey">(417740)</span></li>
<li>/team/group/media_formats-reviewed-trunk/channels/chan_phone.c <span style="color: grey">(417740)</span></li>
<li>/team/group/media_formats-reviewed-trunk/channels/chan_oss.c <span style="color: grey">(417740)</span></li>
<li>/team/group/media_formats-reviewed-trunk/channels/chan_nbs.c <span style="color: grey">(417740)</span></li>
<li>/team/group/media_formats-reviewed-trunk/channels/chan_multicast_rtp.c <span style="color: grey">(417740)</span></li>
<li>/team/group/media_formats-reviewed-trunk/channels/chan_motif.c <span style="color: grey">(417740)</span></li>
<li>/team/group/media_formats-reviewed-trunk/channels/chan_misdn.c <span style="color: grey">(417740)</span></li>
<li>/team/group/media_formats-reviewed-trunk/channels/chan_mgcp.c <span style="color: grey">(417740)</span></li>
<li>/team/group/media_formats-reviewed-trunk/channels/chan_jingle.c <span style="color: grey">(417740)</span></li>
<li>/team/group/media_formats-reviewed-trunk/channels/chan_iax2.c <span style="color: grey">(417740)</span></li>
<li>/team/group/media_formats-reviewed-trunk/channels/chan_h323.c <span style="color: grey">(417740)</span></li>
<li>/team/group/media_formats-reviewed-trunk/channels/chan_gtalk.c <span style="color: grey">(417740)</span></li>
<li>/team/group/media_formats-reviewed-trunk/channels/chan_dahdi.c <span style="color: grey">(417740)</span></li>
<li>/team/group/media_formats-reviewed-trunk/channels/chan_console.c <span style="color: grey">(417740)</span></li>
<li>/team/group/media_formats-reviewed-trunk/channels/chan_bridge_media.c <span style="color: grey">(417740)</span></li>
<li>/team/group/media_formats-reviewed-trunk/channels/chan_alsa.c <span style="color: grey">(417740)</span></li>
<li>/team/group/media_formats-reviewed-trunk/bridges/bridge_softmix.c <span style="color: grey">(417740)</span></li>
<li>/team/group/media_formats-reviewed-trunk/bridges/bridge_simple.c <span style="color: grey">(417740)</span></li>
<li>/team/group/media_formats-reviewed-trunk/bridges/bridge_native_rtp.c <span style="color: grey">(417740)</span></li>
<li>/team/group/media_formats-reviewed-trunk/bridges/bridge_holding.c <span style="color: grey">(417740)</span></li>
<li>/team/group/media_formats-reviewed-trunk/apps/confbridge/conf_chan_record.c <span style="color: grey">(417740)</span></li>
<li>/team/group/media_formats-reviewed-trunk/apps/app_voicemail.c <span style="color: grey">(417740)</span></li>
<li>/team/group/media_formats-reviewed-trunk/apps/app_originate.c <span style="color: grey">(417740)</span></li>
<li>/team/group/media_formats-reviewed-trunk/apps/app_meetme.c <span style="color: grey">(417740)</span></li>
<li>/team/group/media_formats-reviewed-trunk/apps/app_dumpchan.c <span style="color: grey">(417740)</span></li>
<li>/team/group/media_formats-reviewed-trunk/apps/app_confbridge.c <span style="color: grey">(417740)</span></li>
<li>/team/group/media_formats-reviewed-trunk/addons/chan_ooh323.c <span style="color: grey">(417740)</span></li>
<li>/team/group/media_formats-reviewed-trunk/addons/chan_mobile.c <span style="color: grey">(417740)</span></li>
</ul>
<p><a href="https://reviewboard.asterisk.org/r/3689/diff/" style="margin-left: 3em;">View Diff</a></p>
</td>
</tr>
</table>
</div>
</body>
</html>