diff options
author | Matthew Hoops | 2011-01-14 13:01:57 +0000 |
---|---|---|
committer | Matthew Hoops | 2011-01-14 13:01:57 +0000 |
commit | 8ce55fbcde93149bb7644c4fe3c1def8cebe4908 (patch) | |
tree | 0f76754b114faa3858d59a991a0ec0b019dd8999 | |
parent | 06acd962440ea25c40cd890aab984aeeaba2de45 (diff) | |
download | scummvm-rg350-8ce55fbcde93149bb7644c4fe3c1def8cebe4908.tar.gz scummvm-rg350-8ce55fbcde93149bb7644c4fe3c1def8cebe4908.tar.bz2 scummvm-rg350-8ce55fbcde93149bb7644c4fe3c1def8cebe4908.zip |
VIDEO: Reset the pause start time when seeking while paused
svn-id: r55239
-rw-r--r-- | graphics/video/qt_decoder.cpp | 1 | ||||
-rw-r--r-- | graphics/video/video_decoder.cpp | 5 | ||||
-rw-r--r-- | graphics/video/video_decoder.h | 5 |
3 files changed, 11 insertions, 0 deletions
diff --git a/graphics/video/qt_decoder.cpp b/graphics/video/qt_decoder.cpp index d60275acde..150612ff91 100644 --- a/graphics/video/qt_decoder.cpp +++ b/graphics/video/qt_decoder.cpp @@ -178,6 +178,7 @@ void QuickTimeDecoder::seekToFrame(uint32 frame) { // Adjust the video starting point _startTime = g_system->getMillis() - Graphics::VideoTimestamp(_nextFrameStartTime, _streams[_videoStreamIndex]->time_scale).getUnitsInScale(1000); + resetPauseStartTime(); // Adjust the audio starting point if (_audioStreamIndex >= 0) { diff --git a/graphics/video/video_decoder.cpp b/graphics/video/video_decoder.cpp index d1d3445c38..81a8aecb30 100644 --- a/graphics/video/video_decoder.cpp +++ b/graphics/video/video_decoder.cpp @@ -100,6 +100,11 @@ void VideoDecoder::pauseVideo(bool pause) { } } +void VideoDecoder::resetPauseStartTime() { + if (isPaused()) + _pauseStartTime = g_system->getMillis(); +} + uint32 FixedRateVideoDecoder::getTimeToNextFrame() const { if (endOfVideo() || _curFrame < 0) return 0; diff --git a/graphics/video/video_decoder.h b/graphics/video/video_decoder.h index 3d24572818..402bcfe751 100644 --- a/graphics/video/video_decoder.h +++ b/graphics/video/video_decoder.h @@ -176,6 +176,11 @@ protected: */ virtual void addPauseTime(uint32 ms) { _startTime += ms; } + /** + * Reset the pause start time (which should be called when seeking) + */ + void resetPauseStartTime(); + int32 _curFrame; int32 _startTime; |