Fix a regression with rewinding in QuickTime videos (looping works in Riven again) and some minor cleanup.

svn-id: r49206
This commit is contained in:
Matthew Hoops 2010-05-25 02:35:50 +00:00
parent 58a7dbe721
commit ab540af9f8
2 changed files with 3 additions and 9 deletions

View File

@ -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 {

View File

@ -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;