aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authordvossel <dvossel@f38db490-d61c-443f-a65b-d21fe96a405b>2009-07-09 16:19:58 +0000
committerdvossel <dvossel@f38db490-d61c-443f-a65b-d21fe96a405b>2009-07-09 16:19:58 +0000
commit2ef57b7b89d9ca3d5a384f89460d63c1197fb46f (patch)
tree99c0d3ac2efc741185c90206bbe0a9234b780d87 /include
parent97e083be4bc51f35a7f6bb34ce9e0df08011d515 (diff)
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.2@205603 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'include')
-rw-r--r--include/asterisk/time.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/include/asterisk/time.h b/include/asterisk/time.h
index fa8006e2a..895d6df50 100644
--- a/include/asterisk/time.h
+++ b/include/asterisk/time.h
@@ -171,7 +171,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. */
}
)