VOYEUR: Converted RL2 header getFrameRate to use Common::Rational

This commit is contained in:
Paul Gilbert 2014-02-04 00:05:56 -05:00
parent d5231aa862
commit 77d8810b19
3 changed files with 6 additions and 4 deletions

View File

@ -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);
}
/*------------------------------------------------------------------------*/

View File

@ -69,7 +69,7 @@ private:
~RL2FileHeader();
void load(Common::SeekableReadStream *stream);
bool isValid() const;
double getFrameRate() const;
Common::Rational getFrameRate() const;
};
class SoundFrame {

View File

@ -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();