From fe03de724304e9e1952cb7ce05579c820bdb0396 Mon Sep 17 00:00:00 2001 From: Max Horn Date: Tue, 1 Jul 2003 23:50:36 +0000 Subject: 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 --- scumm/smush/smush_player.cpp | 6 ++++-- 1 file 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: -- cgit v1.2.3