From 77d8810b1930368ae3d8fe297d496347d49eca59 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Tue, 4 Feb 2014 00:05:56 -0500 Subject: VOYEUR: Converted RL2 header getFrameRate to use Common::Rational --- engines/voyeur/animation.cpp | 5 +++-- engines/voyeur/animation.h | 2 +- engines/voyeur/voyeur.cpp | 3 ++- 3 files changed, 6 insertions(+), 4 deletions(-) (limited to 'engines') diff --git a/engines/voyeur/animation.cpp b/engines/voyeur/animation.cpp index 57a64945db..5318da26e9 100644 --- a/engines/voyeur/animation.cpp +++ b/engines/voyeur/animation.cpp @@ -220,8 +220,9 @@ bool RL2Decoder::RL2FileHeader::isValid() const { return _signature == MKTAG('R','L','V','2') || _signature != MKTAG('R','L','V','3'); } -double RL2Decoder::RL2FileHeader::getFrameRate() const { - return (_soundRate > 0) ? _rate / _defSoundSize : 11025 / 1103; +Common::Rational RL2Decoder::RL2FileHeader::getFrameRate() const { + return (_soundRate > 0) ? Common::Rational(_rate, _defSoundSize) : + Common::Rational(11025, 1103); } /*------------------------------------------------------------------------*/ diff --git a/engines/voyeur/animation.h b/engines/voyeur/animation.h index 30d60827a2..8ebebaaada 100644 --- a/engines/voyeur/animation.h +++ b/engines/voyeur/animation.h @@ -69,7 +69,7 @@ private: ~RL2FileHeader(); void load(Common::SeekableReadStream *stream); bool isValid() const; - double getFrameRate() const; + Common::Rational getFrameRate() const; }; class SoundFrame { diff --git a/engines/voyeur/voyeur.cpp b/engines/voyeur/voyeur.cpp index 177ee552f0..37dd527b39 100644 --- a/engines/voyeur/voyeur.cpp +++ b/engines/voyeur/voyeur.cpp @@ -565,8 +565,9 @@ void VoyeurEngine::playAVideoDuration(int videoId, int duration) { RL2Decoder decoder; decoder.loadVideo(videoId); + decoder.seek(Audio::Timestamp(_voy._vocSecondsOffset * 1000, + decoder.getHeader().getFrameRate().toInt())); decoder.start(); - decoder.seek(Audio::Timestamp(_voy._vocSecondsOffset * 1000, decoder.getHeader().getFrameRate())); int endFrame = decoder.getCurFrame() + totalFrames; _eventsManager.getMouseInfo(); -- cgit v1.2.3