aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthew Hoops2010-05-25 02:35:50 +0000
committerMatthew Hoops2010-05-25 02:35:50 +0000
commitab540af9f815183fb3bb087e0a7dcab9e62cd847 (patch)
treef1245d339fd23eef6b4cce4813c0e2d693529aab
parent58a7dbe7214c64ce77920e7e63dd9be445ebd805 (diff)
downloadscummvm-rg350-ab540af9f815183fb3bb087e0a7dcab9e62cd847.tar.gz
scummvm-rg350-ab540af9f815183fb3bb087e0a7dcab9e62cd847.tar.bz2
scummvm-rg350-ab540af9f815183fb3bb087e0a7dcab9e62cd847.zip
Fix a regression with rewinding in QuickTime videos (looping works in Riven again) and some minor cleanup.
svn-id: r49206
-rw-r--r--graphics/video/qt_decoder.cpp11
-rw-r--r--graphics/video/qt_decoder.h1
2 files changed, 3 insertions, 9 deletions
diff --git a/graphics/video/qt_decoder.cpp b/graphics/video/qt_decoder.cpp
index 5e50772024..a2d088758d 100644
--- a/graphics/video/qt_decoder.cpp
+++ b/graphics/video/qt_decoder.cpp
@@ -146,9 +146,8 @@ PixelFormat QuickTimeDecoder::getPixelFormat() const {
}
void QuickTimeDecoder::rewind() {
- delete _videoCodec; _videoCodec = NULL;
- _curFrame = -1;
- _startTime = _nextFrameStartTime = 0;
+ VideoDecoder::reset();
+ _nextFrameStartTime = 0;
// Restart the audio too
stopAudio();
@@ -243,11 +242,7 @@ Surface *QuickTimeDecoder::scaleSurface(Surface *frame) {
}
bool QuickTimeDecoder::endOfVideo() const {
- return (!_audStream || _audStream->endOfData()) && (!_videoCodec || _curFrame >= (int32)getFrameCount() - 1);
-}
-
-bool QuickTimeDecoder::needsUpdate() const {
- return !endOfVideo() && getTimeToNextFrame() == 0;
+ return (!_audStream || _audStream->endOfData()) && (!_videoCodec || VideoDecoder::endOfVideo());
}
uint32 QuickTimeDecoder::getElapsedTime() const {
diff --git a/graphics/video/qt_decoder.h b/graphics/video/qt_decoder.h
index 545866f9e5..6d72464258 100644
--- a/graphics/video/qt_decoder.h
+++ b/graphics/video/qt_decoder.h
@@ -112,7 +112,6 @@ public:
bool isVideoLoaded() const { return _fd != 0; }
Surface *decodeNextFrame();
- bool needsUpdate() const;
bool endOfVideo() const;
uint32 getElapsedTime() const;
uint32 getTimeToNextFrame() const;