what ?<br><br>I don&#39;t know what your question is.<br><br><br><br><div class="gmail_quote">On Mon, Apr 6, 2009 at 9:35 AM, seven du <span dir="ltr">&lt;<a href="mailto:seven@idapted.com">seven@idapted.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Hi, can someone explain this  to me?<br>
<br>
In switch_core_media_bug.c, around line 173:<br>
<br>
<br>
<br>
                for (x = 0; x &lt; blen; x++) {<br>
                        int32_t z = 0;<br>
<br>
                        if (x &lt; rlen) {<br>
                                z += (int32_t) *(fp + x);     //what&#39;s difference here with z =<br>
(int32_t) *(fp + x) ?<br>
                        }<br>
                        if (x &lt; wlen) {<br>
                                z += (int32_t) *(dp + x);<br>
                        }<br>
                        switch_normalize_to_16bit(z);<br>
                        *(fp + x) = (int16_t) z / 2;<br>
                }<br>
<br>
And for switch_normalize_to_16bit, according to switch_utils.h,<br>
<br>
#define SWITCH_SMAX 32767<br>
#define SWITCH_SMIN -32768<br>
#define switch_normalize_to_16bit(n) if (n &gt; SWITCH_SMAX) n =<br>
SWITCH_SMAX / 2; else if (n &lt; SWITCH_SMIN) n = SWITCH_SMIN / 2;<br>
<br>
Then<br>
switch_normalize_to_16bit( 32768 ), z = 32767/2, and (int16_t) z / 2 =<br>
32767/4<br>
switch_normalize_to_16bit( 32766) , z = 32766, and (int16_t) z / 2 =<br>
32766/2<br>
<br>
Does that make sense? I guess it should be like this:<br>
<br>
#define switch_normalize_to_16bit(n) if (n &gt; SWITCH_SMAX) n =<br>
SWITCH_SMAX / 2; else if (n &lt; SWITCH_SMIN) n = SWITCH_SMIN / 2; else n<br>
= n / 2;<br>
<br>
                        switch_normalize_to_16bit(z);<br>
                        *(fp + x) = (int16_t) z;<br>
<br>
<br>
Thank you.<br>
<br>
_______________________________________________<br>
Freeswitch-dev mailing list<br>
<a href="mailto:Freeswitch-dev@lists.freeswitch.org">Freeswitch-dev@lists.freeswitch.org</a><br>
<a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-dev" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-dev</a><br>
UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-dev" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-dev</a><br>
<a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br>
</blockquote></div><br><br clear="all"><br>-- <br>Anthony Minessale II<br><br>FreeSWITCH <a href="http://www.freeswitch.org/">http://www.freeswitch.org/</a><br>ClueCon <a href="http://www.cluecon.com/">http://www.cluecon.com/</a><br>
<br>AIM: anthm<br><a href="mailto:MSN%3Aanthony_minessale@hotmail.com">MSN:anthony_minessale@hotmail.com</a><br>GTALK/JABBER/<a href="mailto:PAYPAL%3Aanthony.minessale@gmail.com">PAYPAL:anthony.minessale@gmail.com</a><br>
IRC: <a href="http://irc.freenode.net">irc.freenode.net</a> #freeswitch<br><br>FreeSWITCH Developer Conference<br><a href="mailto:sip%3A888@conference.freeswitch.org">sip:888@conference.freeswitch.org</a><br><a href="http://iax:guest@conference.freeswitch.org/888">iax:guest@conference.freeswitch.org/888</a><br>
<a href="mailto:googletalk%3Aconf%2B888@conference.freeswitch.org">googletalk:conf+888@conference.freeswitch.org</a><br>pstn:213-799-1400<br>