diff options
author | Paul Gilbert | 2014-02-04 00:14:48 -0500 |
---|---|---|
committer | Paul Gilbert | 2014-02-04 00:14:48 -0500 |
commit | bb37927afdd155d78ca5f9f896e8857423da459c (patch) | |
tree | f798e940c94f7473bdcd6aec8ca87cdb483aed45 /engines | |
parent | 77d8810b1930368ae3d8fe297d496347d49eca59 (diff) | |
download | scummvm-rg350-bb37927afdd155d78ca5f9f896e8857423da459c.tar.gz scummvm-rg350-bb37927afdd155d78ca5f9f896e8857423da459c.tar.bz2 scummvm-rg350-bb37927afdd155d78ca5f9f896e8857423da459c.zip |
VOYEUR: Cleaner implementation of RL2Decoder seek
Diffstat (limited to 'engines')
-rw-r--r-- | engines/voyeur/animation.cpp | 4 | ||||
-rw-r--r-- | engines/voyeur/voyeur.cpp | 3 |
2 files changed, 3 insertions, 4 deletions
diff --git a/engines/voyeur/animation.cpp b/engines/voyeur/animation.cpp index 5318da26e9..8206707bc5 100644 --- a/engines/voyeur/animation.cpp +++ b/engines/voyeur/animation.cpp @@ -268,8 +268,8 @@ bool RL2Decoder::RL2VideoTrack::endOfTrack() const { } bool RL2Decoder::RL2VideoTrack::seek(const Audio::Timestamp &time) { - int frame = time.totalNumberOfFrames(); - + int frame = getFrameAtTime(time); + if (frame < 0 || frame >= _header._numFrames) return false; diff --git a/engines/voyeur/voyeur.cpp b/engines/voyeur/voyeur.cpp index 37dd527b39..1142599f12 100644 --- a/engines/voyeur/voyeur.cpp +++ b/engines/voyeur/voyeur.cpp @@ -565,8 +565,7 @@ void VoyeurEngine::playAVideoDuration(int videoId, int duration) { RL2Decoder decoder; decoder.loadVideo(videoId); - decoder.seek(Audio::Timestamp(_voy._vocSecondsOffset * 1000, - decoder.getHeader().getFrameRate().toInt())); + decoder.seek(Audio::Timestamp(_voy._vocSecondsOffset * 1000)); decoder.start(); int endFrame = decoder.getCurFrame() + totalFrames; |