aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--graphics/video/qt_decoder.cpp1
-rw-r--r--graphics/video/video_decoder.cpp5
-rw-r--r--graphics/video/video_decoder.h5
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;