From f04174aa8a0c871dbb2a5523d747ec11d65c036c Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Sun, 30 Oct 2016 11:13:51 -0400 Subject: TITANIC: Fix playing past very last frame of videos --- engines/titanic/support/avi_surface.cpp | 5 +++-- engines/titanic/support/avi_surface.h | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/engines/titanic/support/avi_surface.cpp b/engines/titanic/support/avi_surface.cpp index c3fe54522b..b4d72d43ca 100644 --- a/engines/titanic/support/avi_surface.cpp +++ b/engines/titanic/support/avi_surface.cpp @@ -376,10 +376,11 @@ void AVISurface::playCutscene(const Rect &r, uint startFrame, uint endFrame) { _movieFrameSurface[0]->h != r.height(); startAtFrame(startFrame); - while (!_decoder->endOfVideo() && _currentFrame < (int)endFrame && !g_vm->shouldQuit()) { + while (_currentFrame < (int)endFrame && !g_vm->shouldQuit()) { if (isNextFrame()) { renderFrame(); - _currentFrame = _decoder->getCurFrame(); + _currentFrame = _decoder->endOfVideo() ? _decoder->getFrameCount() : + _decoder->getCurFrame(); if (isDifferent) { // Clear the destination area, and use the transBlitFrom method, diff --git a/engines/titanic/support/avi_surface.h b/engines/titanic/support/avi_surface.h index e4599da03a..8d9b92df40 100644 --- a/engines/titanic/support/avi_surface.h +++ b/engines/titanic/support/avi_surface.h @@ -133,7 +133,7 @@ public: * Return true if a video is currently playing */ virtual bool isPlaying() const { - return _decoder->isPlaying() && !_decoder->endOfVideo(); + return _decoder->isPlaying(); } /** -- cgit v1.2.3