From ab540af9f815183fb3bb087e0a7dcab9e62cd847 Mon Sep 17 00:00:00 2001 From: Matthew Hoops Date: Tue, 25 May 2010 02:35:50 +0000 Subject: Fix a regression with rewinding in QuickTime videos (looping works in Riven again) and some minor cleanup. svn-id: r49206 --- graphics/video/qt_decoder.cpp | 11 +++-------- graphics/video/qt_decoder.h | 1 - 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; -- cgit v1.2.3