diff options
author | Matthew Hoops | 2012-09-19 00:36:03 -0400 |
---|---|---|
committer | Matthew Hoops | 2012-09-19 00:36:03 -0400 |
commit | 8b46b64ad4ba1204a3c95e8fc3b0fe62826f4992 (patch) | |
tree | 1f1666f9a2fcf3e652c51a3763abef0166356ee0 /video | |
parent | 09269fce8c61b8193b25266b681c7849a6ad058d (diff) | |
download | scummvm-rg350-8b46b64ad4ba1204a3c95e8fc3b0fe62826f4992.tar.gz scummvm-rg350-8b46b64ad4ba1204a3c95e8fc3b0fe62826f4992.tar.bz2 scummvm-rg350-8b46b64ad4ba1204a3c95e8fc3b0fe62826f4992.zip |
VIDEO: Fix getTime() after a stop() call
Diffstat (limited to 'video')
-rw-r--r-- | video/video_decoder.cpp | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/video/video_decoder.cpp b/video/video_decoder.cpp index 24287c4d33..b4f44d91b5 100644 --- a/video/video_decoder.cpp +++ b/video/video_decoder.cpp @@ -342,19 +342,23 @@ void VideoDecoder::stop() { if (!isPlaying()) return; + // Stop audio here so we don't have it affect getTime() + stopAudio(); + + // Keep the time marked down in case we start up again + // We do this before _isPlaying is set so we don't get + // _lastTimeChange returned, but before _pauseLevel is + // reset. + _lastTimeChange = getTime(); + _isPlaying = false; _startTime = 0; _palette = 0; _dirtyPalette = false; _needsUpdate = false; - stopAudio(); - // Also reset the pause state. _pauseLevel = 0; - - // Keep the time marked down in case we start up again - _lastTimeChange = getTime(); } Audio::Timestamp VideoDecoder::getDuration() const { |