comparison base/RealTime.cpp @ 912:2175c2ebd5c6 tonioni

Merge from default branch
author Chris Cannam
date Wed, 14 May 2014 09:58:07 +0100
parents 0f363d0fbdc3
children 6a94bb528e9d
comparison
equal deleted inserted replaced
901:68e880e0b857 912:2175c2ebd5c6
440 long 440 long
441 RealTime::realTime2Frame(const RealTime &time, unsigned int sampleRate) 441 RealTime::realTime2Frame(const RealTime &time, unsigned int sampleRate)
442 { 442 {
443 if (time < zeroTime) return -realTime2Frame(-time, sampleRate); 443 if (time < zeroTime) return -realTime2Frame(-time, sampleRate);
444 double s = time.sec + double(time.nsec + 1) / 1000000000.0; 444 double s = time.sec + double(time.nsec + 1) / 1000000000.0;
445 return long(s * sampleRate); 445 return long(s * double(sampleRate));
446 } 446 }
447 447
448 RealTime 448 RealTime
449 RealTime::frame2RealTime(long frame, unsigned int sampleRate) 449 RealTime::frame2RealTime(long frame, unsigned int sampleRate)
450 { 450 {