[Scummvm-git-logs] scummvm master -> 2bf087d2b9246a5a9383aa789465b35a2b4159c4

dreammaster dreammaster at scummvm.org
Sat Oct 22 17:41:08 CEST 2016


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
2bf087d2b9 TITANIC: Workaround for Doorbot's 'cloak off' movie playback


Commit: 2bf087d2b9246a5a9383aa789465b35a2b4159c4
    https://github.com/scummvm/scummvm/commit/2bf087d2b9246a5a9383aa789465b35a2b4159c4
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-10-22T11:40:51-04:00

Commit Message:
TITANIC: Workaround for Doorbot's 'cloak off' movie playback

The original starts a movie for the Doorbot taking his cloak off,
but then plays a cutscene of the doorbot first appearing. Because of
this delay, our VideoDecoder wasn't correctly playing the movie after.
To fix that, new movies are initially paused when started, and then
resumed the first time we try to do events checking for it

Changed paths:
    engines/titanic/support/avi_surface.cpp
    engines/titanic/support/avi_surface.h
    engines/titanic/support/movie.cpp
    engines/titanic/support/movie.h
    engines/titanic/support/video_surface.cpp



diff --git a/engines/titanic/support/avi_surface.cpp b/engines/titanic/support/avi_surface.cpp
index 9e465c7..0745881 100644
--- a/engines/titanic/support/avi_surface.cpp
+++ b/engines/titanic/support/avi_surface.cpp
@@ -114,6 +114,15 @@ void AVISurface::stop() {
 	_movieRangeInfo.destroyContents();
 }
 
+void AVISurface::pause() {
+	_decoder->pauseVideo(true);
+}
+
+void AVISurface::resume() {
+	if (_decoder->isPaused())
+		_decoder->pauseVideo(false);
+}
+
 bool AVISurface::startAtFrame(int frameNumber) {
 	if (isPlaying())
 		// If it's already playing, then don't allow it
diff --git a/engines/titanic/support/avi_surface.h b/engines/titanic/support/avi_surface.h
index b6231a6..b4e6d42 100644
--- a/engines/titanic/support/avi_surface.h
+++ b/engines/titanic/support/avi_surface.h
@@ -120,6 +120,16 @@ public:
 	virtual void stop();
 
 	/**
+	 * Pauses video playback
+	 */
+	virtual void pause();
+
+	/**
+	 * Resumes the video if it's paused
+	 */
+	virtual void resume();
+
+	/**
 	 * Return true if a video is currently playing
 	 */
 	virtual bool isPlaying() const { return _decoder->isPlaying(); }
diff --git a/engines/titanic/support/movie.cpp b/engines/titanic/support/movie.cpp
index aea51e1..2115906 100644
--- a/engines/titanic/support/movie.cpp
+++ b/engines/titanic/support/movie.cpp
@@ -143,6 +143,10 @@ void OSMovie::playCutscene(const Rect &drawRect, uint startFrame, uint endFrame)
 	g_vm->_events->removeTarget();
 }
 
+void OSMovie::pause() {
+	_aviSurface.pause();
+}
+
 void OSMovie::stop() {
 	_aviSurface.stop();
 	removeFromPlayingMovies();
@@ -161,6 +165,10 @@ void OSMovie::setFrame(uint frameNumber) {
 }
 
 bool OSMovie::handleEvents(CMovieEventList &events) {
+	// WORKAROUND: If a movie is paused as part of initial
+	// scene loading, now's the time to un-pause it
+	_aviSurface.resume();
+
 	if (!_aviSurface.isPlaying())
 		return false;
 	if (!_aviSurface.isNextFrame())
diff --git a/engines/titanic/support/movie.h b/engines/titanic/support/movie.h
index acc6470..caeba65 100644
--- a/engines/titanic/support/movie.h
+++ b/engines/titanic/support/movie.h
@@ -90,6 +90,14 @@ public:
 	virtual void playCutscene(const Rect &drawRect, uint startFrame, uint endFrame) = 0;
 
 	/**
+	 * Pauses a movie
+	 * @remarks	Acts a workaround for our video decoder, since some movies started
+	 * as part of a scene load need to be paused until the scene is interactive,
+	 * or else they get played back too quickly
+	 */
+	virtual void pause() = 0;
+
+	/**
 	 * Stops the movie
 	 */
 	virtual void stop() = 0;
@@ -189,6 +197,14 @@ public:
 	virtual void playCutscene(const Rect &drawRect, uint startFrame, uint endFrame);
 
 	/**
+	 * Pauses a movie
+	 * @remarks		Acts a workaround for our video decoder, since some movies started
+	 * as part of a scene load need to be paused until the scene is interactive,
+	 * or else they get played back too quickly
+	 */
+	virtual void pause();
+
+	/**
 	 * Stops the movie
 	 */
 	virtual void stop();
diff --git a/engines/titanic/support/video_surface.cpp b/engines/titanic/support/video_surface.cpp
index 45813bb..2932328 100644
--- a/engines/titanic/support/video_surface.cpp
+++ b/engines/titanic/support/video_surface.cpp
@@ -560,6 +560,7 @@ void OSVideoSurface::playMovie(uint flags, CGameObject *obj) {
 void OSVideoSurface::playMovie(uint startFrame, uint endFrame, uint flags, CGameObject *obj) {
 	if (loadIfReady() && _movie) {
 		_movie->play(startFrame, endFrame, flags, obj);
+		_movie->pause();
 	}
 }
 





More information about the Scummvm-git-logs mailing list