diff options
-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(); } |