aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthew Hoops2012-07-26 23:42:35 -0400
committerMatthew Hoops2012-07-26 23:42:35 -0400
commitdf5d6f7d08c30afa270fd7d3e2d0f885eaf3c7bc (patch)
tree7c6f956545a6a7d2c099c96b48639ef40cd3ec8c
parent84462fa088d64acc2a7b2811f88a5a292abe00db (diff)
downloadscummvm-rg350-df5d6f7d08c30afa270fd7d3e2d0f885eaf3c7bc.tar.gz
scummvm-rg350-df5d6f7d08c30afa270fd7d3e2d0f885eaf3c7bc.tar.bz2
scummvm-rg350-df5d6f7d08c30afa270fd7d3e2d0f885eaf3c7bc.zip
VIDEO: Force an update after a seek
-rw-r--r--video/video_decoder.cpp8
-rw-r--r--video/video_decoder.h2
2 files changed, 8 insertions, 2 deletions
diff --git a/video/video_decoder.cpp b/video/video_decoder.cpp
index 9282cd82d0..9d6d40f7fb 100644
--- a/video/video_decoder.cpp
+++ b/video/video_decoder.cpp
@@ -101,6 +101,7 @@ AdvancedVideoDecoder::AdvancedVideoDecoder() {
_audioVolume = Audio::Mixer::kMaxChannelVolume;
_audioBalance = 0;
_pauseLevel = 0;
+ _needsUpdate = false;
// Find the best format for output
_defaultHighColorFormat = g_system->getScreenFormat();
@@ -124,6 +125,7 @@ void AdvancedVideoDecoder::close() {
_audioVolume = Audio::Mixer::kMaxChannelVolume;
_audioBalance = 0;
_pauseLevel = 0;
+ _needsUpdate = false;
}
bool AdvancedVideoDecoder::isVideoLoaded() const {
@@ -155,6 +157,8 @@ Graphics::PixelFormat AdvancedVideoDecoder::getPixelFormat() const {
}
const Graphics::Surface *AdvancedVideoDecoder::decodeNextFrame() {
+ _needsUpdate = false;
+
readNextPacket();
VideoTrack *track = findNextVideoTrack();
@@ -215,7 +219,7 @@ uint32 AdvancedVideoDecoder::getTime() const {
}
uint32 AdvancedVideoDecoder::getTimeToNextFrame() const {
- if (endOfVideo())
+ if (endOfVideo() || _needsUpdate)
return 0;
const VideoTrack *track = findNextVideoTrack();
@@ -310,6 +314,7 @@ bool AdvancedVideoDecoder::seek(const Audio::Timestamp &time) {
_audioStartOffset = time;
_startTime = g_system->getMillis() - time.msecs();
+ _needsUpdate = true;
return true;
}
@@ -337,6 +342,7 @@ void AdvancedVideoDecoder::stop() {
_audioStartOffset = 0;
_palette = 0;
_dirtyPalette = false;
+ _needsUpdate = false;
stopAllTracks();
diff --git a/video/video_decoder.h b/video/video_decoder.h
index 0c569692fc..ffeecd326d 100644
--- a/video/video_decoder.h
+++ b/video/video_decoder.h
@@ -766,7 +766,7 @@ private:
TrackList _tracks;
// Current playback status
- bool _isPlaying, _needsRewind;
+ bool _isPlaying, _needsRewind, _needsUpdate;
Audio::Timestamp _audioStartOffset;
// Palette settings from individual tracks