diff options
author | Sven Hesse | 2008-12-12 14:28:06 +0000 |
---|---|---|
committer | Sven Hesse | 2008-12-12 14:28:06 +0000 |
commit | 63ddc1ba6fdfaa4ef9a60fe5a4457512bbe3371f (patch) | |
tree | 8898fe74e357d79f101be0b8dcba62772c52336f | |
parent | cfa939d1510d0630a81cec41fc94a61b9908693e (diff) | |
download | scummvm-rg350-63ddc1ba6fdfaa4ef9a60fe5a4457512bbe3371f.tar.gz scummvm-rg350-63ddc1ba6fdfaa4ef9a60fe5a4457512bbe3371f.tar.bz2 scummvm-rg350-63ddc1ba6fdfaa4ef9a60fe5a4457512bbe3371f.zip |
Using AppandableAudioStream::getTotalPlayTime() instead of the difference between current and start time to sync audio and video
svn-id: r35315
-rw-r--r-- | engines/gob/coktelvideo.cpp | 10 | ||||
-rw-r--r-- | engines/gob/coktelvideo.h | 5 |
2 files changed, 3 insertions, 12 deletions
diff --git a/engines/gob/coktelvideo.cpp b/engines/gob/coktelvideo.cpp index 555ce1612c..cb3449615b 100644 --- a/engines/gob/coktelvideo.cpp +++ b/engines/gob/coktelvideo.cpp @@ -330,7 +330,7 @@ void Imd::waitEndFrame() { if (_skipFrames == 0) { int32 waitTime = (int16) (((_curFrame * _soundSliceLength) - - ((g_system->getMillis() - _soundStartTime) << 16)) >> 16); + (_audioStream->getTotalPlayTime() << 16)) >> 16); if (waitTime < 0) { _skipFrames = -waitTime / (_soundSliceLength >> 16); @@ -344,11 +344,6 @@ void Imd::waitEndFrame() { g_system->delayMillis(_frameLength); } -void Imd::notifyPaused(uint32 duration) { - if (_soundStage == 2) - _soundStartTime += duration; -} - void Imd::copyCurrentFrame(byte *dest, uint16 left, uint16 top, uint16 width, uint16 height, uint16 x, uint16 y, uint16 pitch, int16 transp) { @@ -444,7 +439,6 @@ void Imd::clear(bool del) { _hasSound = false; _soundEnabled = false; _soundStage = 0; - _soundStartTime = 0; _skipFrames = 0; _soundFlags = 0; @@ -638,7 +632,6 @@ CoktelVideo::State Imd::processFrame(uint16 frame) { if (startSound && _soundEnabled) { _mixer->playInputStream(Audio::Mixer::kSFXSoundType, &_audioHandle, _audioStream); - _soundStartTime = g_system->getMillis(); _skipFrames = 0; _soundStage = 2; } @@ -1276,7 +1269,6 @@ CoktelVideo::State Vmd::processFrame(uint16 frame) { if (startSound && _soundEnabled) { _mixer->playInputStream(Audio::Mixer::kSFXSoundType, &_audioHandle, _audioStream); - _soundStartTime = g_system->getMillis(); _skipFrames = 0; _soundStage = 2; } diff --git a/engines/gob/coktelvideo.h b/engines/gob/coktelvideo.h index 51e61a2979..ebef56dd62 100644 --- a/engines/gob/coktelvideo.h +++ b/engines/gob/coktelvideo.h @@ -215,6 +215,8 @@ public: bool hasExtraData(const char *fileName) const { return false; } Common::MemoryReadStream *getExtraData(const char *fileName) { return 0; } + void notifyPaused(uint32 duration) { } + void setFrameRate(int16 frameRate); bool load(Common::SeekableReadStream &stream); @@ -234,8 +236,6 @@ public: State nextFrame(); void waitEndFrame(); - void notifyPaused(uint32 duration); - void copyCurrentFrame(byte *dest, uint16 left, uint16 top, uint16 width, uint16 height, uint16 x, uint16 y, uint16 pitch, int16 transp = -1); @@ -272,7 +272,6 @@ protected: bool _hasSound; bool _soundEnabled; uint8 _soundStage; // (0: no sound, 1: loaded, 2: playing) - uint32 _soundStartTime; uint32 _skipFrames; uint16 _soundFlags; |