aboutsummaryrefslogtreecommitdiff
path: root/engines/gob/coktelvideo.cpp
diff options
context:
space:
mode:
authorSven Hesse2008-05-25 23:12:32 +0000
committerSven Hesse2008-05-25 23:12:32 +0000
commit6ef8e5238bf33205e4945334987aafe0f43a8405 (patch)
tree5610de14e359c44df668c5905f32eb3538126c66 /engines/gob/coktelvideo.cpp
parent1fcf93875ec583c23232088cac3ad15c254bfccc (diff)
downloadscummvm-rg350-6ef8e5238bf33205e4945334987aafe0f43a8405.tar.gz
scummvm-rg350-6ef8e5238bf33205e4945334987aafe0f43a8405.tar.bz2
scummvm-rg350-6ef8e5238bf33205e4945334987aafe0f43a8405.zip
Increased _soundSliceLength's accuracy. This fixes the A/V sync problems in Woodruff's intro
svn-id: r32274
Diffstat (limited to 'engines/gob/coktelvideo.cpp')
-rw-r--r--engines/gob/coktelvideo.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/engines/gob/coktelvideo.cpp b/engines/gob/coktelvideo.cpp
index ef89bc2c19..be639fae9f 100644
--- a/engines/gob/coktelvideo.cpp
+++ b/engines/gob/coktelvideo.cpp
@@ -123,8 +123,9 @@ bool Imd::load(Common::SeekableReadStream &stream) {
return false;
}
- _soundSliceLength = 1000 / (_soundFreq / _soundSliceSize);
- _frameLength = _soundSliceLength;
+ _soundSliceLength = (uint32) (((double) (1000 << 16)) /
+ ((double) _soundFreq / (double) _soundSliceSize));
+ _frameLength = _soundSliceLength >> 16;
_soundStage = 1;
_hasSound = true;
@@ -325,8 +326,8 @@ void Imd::waitEndFrame() {
return;
if (_skipFrames == 0) {
- int32 waitTime = (_curFrame * _soundSliceLength) -
- (g_system->getMillis() - _soundStartTime);
+ int32 waitTime = ((_curFrame * _soundSliceLength) -
+ ((g_system->getMillis() - _soundStartTime) << 16)) >> 16;
if (waitTime < 0) {
_skipFrames = -waitTime / _soundSliceLength;
@@ -943,10 +944,9 @@ bool Vmd::load(Common::SeekableReadStream &stream) {
_soundSliceSize = -_soundSliceSize;
}
- _soundSliceLength = (uint16) (1000.0 /
+ _soundSliceLength = (uint32) (((double) (1000 << 16)) /
((double) _soundFreq / (double) _soundSliceSize));
-
- _frameLength = _soundSliceLength;
+ _frameLength = _soundSliceLength >> 16;
_soundStage = 1;
_audioStream = Audio::makeAppendableAudioStream(_soundFreq,