diff options
author | Paul Gilbert | 2014-02-04 00:05:56 -0500 |
---|---|---|
committer | Paul Gilbert | 2014-02-04 00:05:56 -0500 |
commit | 77d8810b1930368ae3d8fe297d496347d49eca59 (patch) | |
tree | aef10de701f28481a3cf366df6e274952c5f19ee /engines | |
parent | d5231aa862538bba94e456fd70fbdeb6a4b0f9ca (diff) | |
download | scummvm-rg350-77d8810b1930368ae3d8fe297d496347d49eca59.tar.gz scummvm-rg350-77d8810b1930368ae3d8fe297d496347d49eca59.tar.bz2 scummvm-rg350-77d8810b1930368ae3d8fe297d496347d49eca59.zip |
VOYEUR: Converted RL2 header getFrameRate to use Common::Rational
Diffstat (limited to 'engines')
-rw-r--r-- | engines/voyeur/animation.cpp | 5 | ||||
-rw-r--r-- | engines/voyeur/animation.h | 2 | ||||
-rw-r--r-- | engines/voyeur/voyeur.cpp | 3 |
3 files changed, 6 insertions, 4 deletions
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(); |