From b6f6a980abc3fadbec2fec5064f017cea6fe22ab Mon Sep 17 00:00:00 2001 From: dvossel Date: Thu, 9 Jul 2009 16:21:10 +0000 Subject: Merged revisions 205600 via svnmerge from https://origsvn.digium.com/svn/asterisk/trunk ................ r205600 | dvossel | 2009-07-09 11:19:09 -0500 (Thu, 09 Jul 2009) | 9 lines 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. ........ ................ git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.6.0@205608 f38db490-d61c-443f-a65b-d21fe96a405b --- include/asterisk/time.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/asterisk/time.h b/include/asterisk/time.h index 3720793de..143e23ee1 100644 --- a/include/asterisk/time.h +++ b/include/asterisk/time.h @@ -172,7 +172,7 @@ struct timeval ast_tv(ast_time_t sec, ast_suseconds_t usec), 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. */ } ) -- cgit v1.2.3