aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMax Horn2003-07-01 23:50:36 +0000
committerMax Horn2003-07-01 23:50:36 +0000
commitfe03de724304e9e1952cb7ce05579c820bdb0396 (patch)
tree443ca86be061acf0f20ee8a43a759c3cdfbed046
parentcff9817d443e59ff2ab4dc696793a4b17b274eec (diff)
downloadscummvm-rg350-fe03de724304e9e1952cb7ce05579c820bdb0396.tar.gz
scummvm-rg350-fe03de724304e9e1952cb7ce05579c820bdb0396.tar.bz2
scummvm-rg350-fe03de724304e9e1952cb7ce05579c820bdb0396.zip
fix for the 'invalid seeks' that sometimes occured at the end of smush playback (well I hope - at least now I can't reproduce the problem anymore with my testcases)
svn-id: r8695
-rw-r--r--scumm/smush/smush_player.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/scumm/smush/smush_player.cpp b/scumm/smush/smush_player.cpp
index 44bace3e52..00dc9e507f 100644
--- a/scumm/smush/smush_player.cpp
+++ b/scumm/smush/smush_player.cpp
@@ -257,9 +257,11 @@ void SmushPlayer::init() {
}
void SmushPlayer::deinit() {
+ _scumm->_timer->releaseProcedure(&timerCallback);
_scumm->_smushPlay = false;
+ // In case the timerCallback is active right now, we loop till it finishes.
+ // Note: even this still leaves a window for race conditions to occur.
while (_smushProcessFrame) {}
- _scumm->_timer->releaseProcedure(&timerCallback);
for (int i = 0; i < 5; i++) {
if (_sf[i]) {
@@ -849,11 +851,11 @@ void SmushPlayer::setupAnim(const char *file, const char *directory) {
}
void SmushPlayer::parseNextFrame() {
- Chunk *sub = _base->subBlock();
if (_base->eof()) {
_scumm->_videoFinished = true;
return;
}
+ Chunk *sub = _base->subBlock();
switch(sub->getType()) {
case TYPE_FRME: