diff options
author | Bastien Bouclet | 2014-09-14 15:07:50 +0200 |
---|---|---|
committer | Bastien Bouclet | 2014-12-20 19:38:18 +0100 |
commit | 200b05246c3e90e61fe6d2e21507b0b936d0ff2b (patch) | |
tree | 979a46fc580d65aa12d7e7c7cf27775aaacf3f03 /audio | |
parent | 0f590561bd0fe7238fcfd5fcee0d8a4dc11b9979 (diff) | |
download | scummvm-rg350-200b05246c3e90e61fe6d2e21507b0b936d0ff2b.tar.gz scummvm-rg350-200b05246c3e90e61fe6d2e21507b0b936d0ff2b.tar.bz2 scummvm-rg350-200b05246c3e90e61fe6d2e21507b0b936d0ff2b.zip |
AUDIO: Wrap around in the Timestamp constructor
The "making of" video in the Xbox version of Myst III is
unusually long. VideoDecoder::FixedRateVideoTrack::getFrameTime
would trigger an overflow.
Diffstat (limited to 'audio')
-rw-r--r-- | audio/timestamp.cpp | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/audio/timestamp.cpp b/audio/timestamp.cpp index 1ce971631c..63752812e1 100644 --- a/audio/timestamp.cpp +++ b/audio/timestamp.cpp @@ -39,12 +39,10 @@ Timestamp::Timestamp(uint ms, uint fr) { Timestamp::Timestamp(uint s, uint frames, uint fr) { assert(fr > 0); - _secs = s; + _secs = s + (frames / fr); _framerateFactor = 1000 / Common::gcd<uint>(1000, fr); _framerate = fr * _framerateFactor; - _numFrames = frames * _framerateFactor; - - normalize(); + _numFrames = (frames % fr) * _framerateFactor; } Timestamp Timestamp::convertToFramerate(uint newFramerate) const { |