diff options
author | Paul Gilbert | 2010-10-15 10:52:23 +0000 |
---|---|---|
committer | Paul Gilbert | 2010-10-15 10:52:23 +0000 |
commit | 96585f24d97f548d63652585fcfaf6d1599a1aac (patch) | |
tree | a40d45da0535ceb833f0ba217644eb2a5cfcecf5 /engines | |
parent | 9b9e8f7d8dd8858d49c9dabbf07eab0cde6ec919 (diff) | |
download | scummvm-rg350-96585f24d97f548d63652585fcfaf6d1599a1aac.tar.gz scummvm-rg350-96585f24d97f548d63652585fcfaf6d1599a1aac.tar.bz2 scummvm-rg350-96585f24d97f548d63652585fcfaf6d1599a1aac.zip |
SWORD25: Fix unloading of movies so the menu animation properly loops
svn-id: r53474
Diffstat (limited to 'engines')
-rw-r--r-- | engines/sword25/fmv/movieplayer.cpp | 18 | ||||
-rw-r--r-- | engines/sword25/fmv/theora_decoder.cpp | 3 |
2 files changed, 12 insertions, 9 deletions
diff --git a/engines/sword25/fmv/movieplayer.cpp b/engines/sword25/fmv/movieplayer.cpp index 164f46eb09..d58c630759 100644 --- a/engines/sword25/fmv/movieplayer.cpp +++ b/engines/sword25/fmv/movieplayer.cpp @@ -130,17 +130,21 @@ bool MoviePlayer::pause() { void MoviePlayer::update() { if (_decoder.isVideoLoaded()) { Graphics::Surface *s = _decoder.decodeNextFrame(); - - // Transfer the next frame - assert(s->bytesPerPixel == 4); + if (s) { + // Transfer the next frame + assert(s->bytesPerPixel == 4); #if INDIRECTRENDERING - byte *frameData = (byte *)s->getBasePtr(0, 0); - _outputBitmap->setContent(frameData, s->pitch * s->h, 0, s->pitch); + byte *frameData = (byte *)s->getBasePtr(0, 0); + _outputBitmap->setContent(frameData, s->pitch * s->h, 0, s->pitch); #else - g_system->copyRectToScreen((byte *)s->getBasePtr(0, 0), s->pitch, _outX, _outY, MIN(s->w, _backSurface->w), MIN(s->h, _backSurface->h)); - g_system->updateScreen(); + g_system->copyRectToScreen((byte *)s->getBasePtr(0, 0), s->pitch, _outX, _outY, MIN(s->w, _backSurface->w), MIN(s->h, _backSurface->h)); + g_system->updateScreen(); #endif + } else { + // Movie complete, so unload the movie + unloadMovie(); + } } } diff --git a/engines/sword25/fmv/theora_decoder.cpp b/engines/sword25/fmv/theora_decoder.cpp index c5c29a8160..8d30aa07ea 100644 --- a/engines/sword25/fmv/theora_decoder.cpp +++ b/engines/sword25/fmv/theora_decoder.cpp @@ -399,8 +399,7 @@ Graphics::Surface *TheoraDecoder::decodeNextFrame() { } if (!_videobufReady && !_audiobufReady && _fileStream->eos()) { - close(); - return _surface; + return NULL; } if (!_videobufReady || !_audiobufReady) { |