[asterisk-commits] dvossel: branch 1.4 r205215 - /branches/1.4/include/asterisk/time.h

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Wed Jul 8 11:53:43 CDT 2009


Author: dvossel
Date: Wed Jul  8 11:53:40 2009
New Revision: 205215

URL: http://svn.asterisk.org/svn-view/asterisk?view=rev&rev=205215
Log:
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/

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=205215&r1=205214&r2=205215
==============================================================================
--- branches/1.4/include/asterisk/time.h (original)
+++ branches/1.4/include/asterisk/time.h Wed Jul  8 11:53:40 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 / _rate));
+	return ast_tv(_nsamp / _rate, (_nsamp % _rate) * (1000000 / (float) _rate));
 }
 )
 




More information about the asterisk-commits mailing list