[svn-commits] dvossel: branch 1.4 r205599 - /branches/1.4/include/asterisk/time.h
SVN commits to the Digium repositories
svn-commits at lists.digium.com
Thu Jul 9 11:18:12 CDT 2009
Author: dvossel
Date: Thu Jul 9 11:18:09 2009
New Revision: 205599
URL: http://svn.asterisk.org/svn-view/asterisk?view=rev&rev=205599
Log:
Changing ast_samp2tv to not use floating point.
Modified:
branches/1.4/include/asterisk/time.h
Modified: branches/1.4/include/asterisk/time.h
URL: http://svn.asterisk.org/svn-view/asterisk/branches/1.4/include/asterisk/time.h?view=diff&rev=205599&r1=205598&r2=205599
==============================================================================
--- branches/1.4/include/asterisk/time.h (original)
+++ branches/1.4/include/asterisk/time.h Thu Jul 9 11:18:09 2009
@@ -137,7 +137,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 svn-commits
mailing list