<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/2742/">https://reviewboard.asterisk.org/r/2742/</a>
</td>
</tr>
</table>
<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/2742/diff/2/?file=43784#file43784line475" style="color: black; font-weight: bold; text-decoration: underline;">/trunk/res/res_musiconhold.c</a>
<span style="font-weight: normal;">
(Diff revision 2)
</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; ">static int moh_files_generator(struct ast_channel *chan, void *data, int len, int samples)</pre></td>
</tr>
</tbody>
<tbody>
<tr>
<th bgcolor="#e9eaa8" style="border-right: 1px solid #C0C0C0;" align="right"><font size="2">470</font></th>
<td bgcolor="#fdfebc" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "><span class="cm"><span class="tb">        </span> * might only happen when two reloads are generated in a short period of</span></pre></td>
<th bgcolor="#e9eaa8" style="border-left: 1px solid #C0C0C0; border-right: 1px solid #C0C0C0;" align="right"><font size="2">444</font></th>
<td bgcolor="#fdfebc" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "><span class="cm"><span class="tb">        </span> * </span><span class="cs">XXX</span><span class="cm">: Can't it? Even though state->class is unreffed above, class</span></pre></td>
</tr>
<tr>
<th bgcolor="#e9eaa8" style="border-right: 1px solid #C0C0C0;" align="right"><font size="2">471</font></th>
<td bgcolor="#fdfebc" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "><span class="cm"><span class="tb">        </span> * time, but it's still important to protect against.</span></pre></td>
<th bgcolor="#e9eaa8" style="border-left: 1px solid #C0C0C0; border-right: 1px solid #C0C0C0;" align="right"><font size="2">445</font></th>
<td bgcolor="#fdfebc" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "><span class="cm"><span class="tb">        </span> * itself is still reffed, so no one else would be using that memory.</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;">class is definitely still reffed and valid given its usage in the calling 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/2742/diff/2/?file=43784#file43784line484" style="color: black; font-weight: bold; text-decoration: underline;">/trunk/res/res_musiconhold.c</a>
<span style="font-weight: normal;">
(Diff revision 2)
</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; ">static int moh_files_generator(struct ast_channel *chan, void *data, int len, int samples)</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">453</font></th>
<td bgcolor="#c5ffc4" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "><span class="ew"><span class="tb">        </span></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;">Red blob.</pre>
</div>
<br />
<p>- opticron</p>
<br />
<p>On August 5th, 2013, 8:49 a.m. CDT, wdoekes 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.png'); background-position: left top; background-repeat: repeat-x; border: 1px black solid;">
<tr>
<td>
<div>Review request for Asterisk Developers and Tilghman Lesher.</div>
<div>By wdoekes.</div>
<p style="color: grey;"><i>Updated Aug. 5, 2013, 8:49 a.m.</i></p>
<div style="margin-top: 1.5em;">
<b style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Bugs: </b>
<a href="https://issues.asterisk.org/jira/browse/ASTERISK-21775">ASTERISK-21775</a>,
<a href="https://issues.asterisk.org/jira/browse/ASTERISK-22252">ASTERISK-22252</a>
</div>
<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 review concerns cleanup of the res_musiconhold code.
(1) Removed the special REF_DEBUG code which -- as far as I could tell -- only caused problems when enabling REF_DEBUG.
@tilghman: if the code should still be in there, could you explain why?
See bug: ASTERISK-22252
(2) Reduce duplicate code, remove unreachable code, remove commented-out code.
Among other things:
- Removing the HANDLE_REF argument to moh_register(). Doing the unref manually
takes only one line of code.
- init_app_class() gets a bit less code, but is now reused by another caller. I
had to add "XXX: why don't we check for failure (ast_timer_open()) here?"
because I didn't get why there was a difference.
- Renamed `mohclass` to `other` in moh_register(). The module won't get an A for
properly named variables.
(3) Use `init_files_class` instead of `moh_scan_files` directly, because it returns
<0 for failure and >0 for success and it was only checked for zero (= no files).
(4) Added the patch by Michael Young from ASTERISK-21775, which seems correct to me.
(5) free()'s were encountered that should be ast_free()'s.
The astobj2.c:162 INTERNAL_OBJ: bad magic number 0xdeaddead for object 0x7faf44978818
errors I get are not solved, but they're still here when noloading musiconhold,
so they're unrelated.
(6) Added comment about LOGIC by tilghman:
- This referred to the previous situation the bare class pointer was compared
against the state->class pointer. This was changed to take state->name into
account.
- When we get to this part, class is reffed, so comparing anything to class should
be ok, even if state->class is not reffed. Right?
(7) Fixed so realtime cachedrtclasses works with non-files mode.</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;">Used the refcounter(1) to check that things were fine when:
- moh reload'ing
- playing standard musiconhold ("files")
- playing cached RT musiconhold ("files")
- playing uncached RT musiconhold ("files")
- playing standard musiconhold ("quietmp3")
- playing cached RT musiconhold ("quietmp3")
- playing uncached RT musiconhold ("quietmp3")
Tested that the quietmp3 mode re-used the same spawned mpg123 for both realtime MOH classes when CACHERTCLASSES is true.</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>/trunk/res/res_musiconhold.c <span style="color: grey">(396165)</span></li>
</ul>
<p><a href="https://reviewboard.asterisk.org/r/2742/diff/" style="margin-left: 3em;">View Diff</a></p>
</td>
</tr>
</table>
</div>
</body>
</html>