Mercurial > hg > vamp-plugin-sdk
comparison vamp-sdk/RealTime.cpp @ 30:4412c619b373 vamp-plugin-sdk-v0.9rc2
* Fix rounding error in RealTime (thanks to Craig Sapp)
author | cannam |
---|---|
date | Tue, 16 May 2006 11:48:27 +0000 |
parents | 83d3eb580731 |
children | e33fa45f0935 |
comparison
equal
deleted
inserted
replaced
29:d97aafa99828 | 30:4412c619b373 |
---|---|
85 } | 85 } |
86 | 86 |
87 RealTime | 87 RealTime |
88 RealTime::fromSeconds(double sec) | 88 RealTime::fromSeconds(double sec) |
89 { | 89 { |
90 return RealTime(int(sec), int((sec - int(sec)) * ONE_BILLION)); | 90 return RealTime(int(sec), int((sec - int(sec)) * ONE_BILLION + 0.5)); |
91 } | 91 } |
92 | 92 |
93 RealTime | 93 RealTime |
94 RealTime::fromMilliseconds(int msec) | 94 RealTime::fromMilliseconds(int msec) |
95 { | 95 { |