]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
Merged revisions 205216 via svnmerge from
authorDavid Vossel <dvossel@digium.com>
Wed, 8 Jul 2009 16:56:13 +0000 (16:56 +0000)
committerDavid Vossel <dvossel@digium.com>
Wed, 8 Jul 2009 16:56:13 +0000 (16:56 +0000)
https://origsvn.digium.com/svn/asterisk/trunk

................
  r205216 | dvossel | 2009-07-08 11:54:24 -0500 (Wed, 08 Jul 2009) | 17 lines

  Merged revisions 205215 via svnmerge from
  https://origsvn.digium.com/svn/asterisk/branches/1.4

  ........
    r205215 | dvossel | 2009-07-08 11:53:40 -0500 (Wed, 08 Jul 2009) | 10 lines

    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: https://origsvn.digium.com/svn/asterisk/branches/1.6.1@205218 65c4cc65-6c06-0410-ace0-fbb531ad65f3

include/asterisk/time.h

index 4b7ca00ff94832ad4f7013cde2f2deddc29766d4..fa8006e2a2135e05ad9a52de02b072573b08afb5 100644 (file)
@@ -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 / _rate));
+       return ast_tv(_nsamp / _rate, (_nsamp % _rate) * (1000000 / (float) _rate));
 }
 )