diff options
Diffstat (limited to 'engines/titanic/support/avi_surface.cpp')
-rw-r--r-- | engines/titanic/support/avi_surface.cpp | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/engines/titanic/support/avi_surface.cpp b/engines/titanic/support/avi_surface.cpp index 69c006e6e8..11b6b68ca4 100644 --- a/engines/titanic/support/avi_surface.cpp +++ b/engines/titanic/support/avi_surface.cpp @@ -472,11 +472,20 @@ Graphics::ManagedSurface *AVISurface::duplicateTransparency() const { } void AVISurface::playCutscene(const Rect &r, uint startFrame, uint endFrame) { - bool isDifferent = _movieFrameSurface[0]->w != r.width() || - _movieFrameSurface[0]->h != r.height(); - - startAtFrame(startFrame); - _currentFrame = startFrame; + bool isDifferent = false; + + if (_currentFrame != ((int)startFrame - 1) || startFrame == 0) { + // Start video playback at the desired starting frame + setFrame(startFrame); + isDifferent = _movieFrameSurface[0]->w != r.width() || + _movieFrameSurface[0]->h != r.height(); + + startAtFrame(startFrame); + _currentFrame = startFrame; + } else { + // Already in position, so pick up where we left off + _decoder->start(); + } while (_currentFrame < (int)endFrame && !g_vm->shouldQuit()) { if (isNextFrame()) { |