diff options
author | Matthew Hoops | 2015-01-16 01:53:53 -0500 |
---|---|---|
committer | Matthew Hoops | 2015-01-20 20:10:58 -0500 |
commit | aaf4d38a56219c63ee41638e93ef83f66f309b23 (patch) | |
tree | 4112e197d37dcb2aec6f787996be7ddb280302e4 /video/qt_decoder.cpp | |
parent | a59f5db505ffce9567c3bc8adf30d2f843910d65 (diff) | |
download | scummvm-rg350-aaf4d38a56219c63ee41638e93ef83f66f309b23.tar.gz scummvm-rg350-aaf4d38a56219c63ee41638e93ef83f66f309b23.tar.bz2 scummvm-rg350-aaf4d38a56219c63ee41638e93ef83f66f309b23.zip |
VIDEO: Round the edit time offset instead of truncating it
Allows for the KQ6 Mac intro to play without the edit "-1" hack
Diffstat (limited to 'video/qt_decoder.cpp')
-rw-r--r-- | video/qt_decoder.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/video/qt_decoder.cpp b/video/qt_decoder.cpp index 2012e369e7..14102794c4 100644 --- a/video/qt_decoder.cpp +++ b/video/qt_decoder.cpp @@ -721,7 +721,12 @@ const Graphics::Surface *QuickTimeDecoder::VideoTrackHandler::bufferNextFrame() uint32 QuickTimeDecoder::VideoTrackHandler::getRateAdjustedFrameTime() const { // Figure out what time the next frame is at taking the edit list rate into account - uint32 convertedTime = (Common::Rational(_nextFrameStartTime - getCurEditTimeOffset()) / _parent->editList[_curEdit].mediaRate).toInt(); + Common::Rational offsetFromEdit = Common::Rational(_nextFrameStartTime - getCurEditTimeOffset()) / _parent->editList[_curEdit].mediaRate; + uint32 convertedTime = offsetFromEdit.toInt(); + + if ((offsetFromEdit.getNumerator() % offsetFromEdit.getDenominator()) > (offsetFromEdit.getDenominator() / 2)) + convertedTime++; + return convertedTime + getCurEditTimeOffset(); } |