When ESCing videos, seek to the last frame that was meant to be played. Fixes graphical glitches (bug #2830985) and crashes (bug #2830988)

svn-id: r42995
This commit is contained in:
Sven Hesse 2009-08-02 10:40:27 +00:00
parent 01886d3e52
commit 1471f0e3dd
2 changed files with 3 additions and 0 deletions

View File

@ -739,6 +739,8 @@ bool VideoPlayer::doPlay(int16 frame, int16 breakKey,
_vm->_inter->storeKey(_vm->_util->checkKey());
if (VAR(0) == (unsigned) breakKey) {
_primaryVideo->getVideo()->disableSound();
// Seek to the last frame. Some scripts depend on that.
_primaryVideo->getVideo()->seekFrame(endFrame, SEEK_SET, true);
return true;
}
}

View File

@ -423,6 +423,7 @@ void Imd::seekFrame(int32 frame, int16 whence, bool restart) {
} else if (restart && (_soundStage == 0)) {
for (int i = ((frame > _curFrame) ? _curFrame : 0); i <= frame; i++)
processFrame(i);
return;
} else
error("Imd::seekFrame(): Frame %d is not directly accessible", frame);