[asterisk-commits] dvossel: trunk r205600 - in /trunk: ./ include/asterisk/time.h

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Thu Jul 9 11:19:13 CDT 2009


Author: dvossel
Date: Thu Jul  9 11:19:09 2009
New Revision: 205600

URL: http://svn.asterisk.org/svn-view/asterisk?view=rev&rev=205600
Log:
Merged revisions 205599 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r205599 | dvossel | 2009-07-09 11:18:09 -0500 (Thu, 09 Jul 2009) | 2 lines
  
  Changing ast_samp2tv to not use floating point.
........

Modified:
    trunk/   (props changed)
    trunk/include/asterisk/time.h

Propchange: trunk/
------------------------------------------------------------------------------
Binary property 'branch-1.4-merged' - no diff available.

Modified: trunk/include/asterisk/time.h
URL: http://svn.asterisk.org/svn-view/asterisk/trunk/include/asterisk/time.h?view=diff&rev=205600&r1=205599&r2=205600
==============================================================================
--- trunk/include/asterisk/time.h (original)
+++ trunk/include/asterisk/time.h Thu Jul  9 11:19:09 2009
@@ -171,7 +171,7 @@
 AST_INLINE_API(
 struct timeval ast_samp2tv(unsigned int _nsamp, unsigned int _rate),
 {
-	return ast_tv(_nsamp / _rate, (_nsamp % _rate) * (1000000 / (float) _rate));
+	return ast_tv(_nsamp / _rate, ((_nsamp % _rate) * (4000000 / _rate)) / 4); /* this calculation is accurate up to 32000Hz. */
 }
 )
 




More information about the asterisk-commits mailing list