aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authordvossel <dvossel@f38db490-d61c-443f-a65b-d21fe96a405b>2009-07-08 16:53:40 +0000
committerdvossel <dvossel@f38db490-d61c-443f-a65b-d21fe96a405b>2009-07-08 16:53:40 +0000
commitb2be453f4e360e1b4c155c638096340292656833 (patch)
treead76d77c3bfb894aa1b6915da96fd2af2b4e43b9 /include
parenta54da21f469cc0914c876b8bff3c1225be6727fb (diff)
ast_samp2tv needs floating point for 16khz audio
In ast_samp2tv(), (1000000 / _rate) = 62.5 when _rate is 16000. The .5 is currently stripped off because we don't calculate using floating points. This causes madness with 16khz audio. (issue ABE-1899) Review: https://reviewboard.asterisk.org/r/305/ git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@205215 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 92a5346a5..306ea7ffb 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 / _rate));
+ return ast_tv(_nsamp / _rate, (_nsamp % _rate) * (1000000 / (float) _rate));
}
)