aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authordvossel <dvossel@f38db490-d61c-443f-a65b-d21fe96a405b>2009-07-09 16:18:09 +0000
committerdvossel <dvossel@f38db490-d61c-443f-a65b-d21fe96a405b>2009-07-09 16:18:09 +0000
commitccd3e875eb8c9134594217aee36ee105bc20c63a (patch)
tree0470791645dde8b60b4aeb570fdd78558ccb2320 /include
parent469d4554bdb830e1006ea6f6412bb8e597e257d5 (diff)
Changing ast_samp2tv to not use floating point.
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@205599 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 306ea7ffb..103e25c1e 100644
--- a/include/asterisk/time.h
+++ b/include/asterisk/time.h
@@ -137,7 +137,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. */
}
)