[Scummvm-git-logs] scummvm master -> 28c461e2f93819ab3a524023d5453ad5f32943e9

dreammaster dreammaster at scummvm.org
Sat Jul 1 04:59:57 CEST 2017


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:
28c461e2f9 TITANIC: Don't set movie framerate until after movie has started


Commit: 28c461e2f93819ab3a524023d5453ad5f32943e9
    https://github.com/scummvm/scummvm/commit/28c461e2f93819ab3a524023d5453ad5f32943e9
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2017-06-30T22:59:29-04:00

Commit Message:
TITANIC: Don't set movie framerate until after movie has started

Changed paths:
    engines/titanic/game/service_elevator_window.cpp
    engines/titanic/support/avi_surface.cpp


diff --git a/engines/titanic/game/service_elevator_window.cpp b/engines/titanic/game/service_elevator_window.cpp
index d548bbf..887fd3d 100644
--- a/engines/titanic/game/service_elevator_window.cpp
+++ b/engines/titanic/game/service_elevator_window.cpp
@@ -68,17 +68,19 @@ bool CServiceElevatorWindow::ServiceElevatorFloorChangeMsg(CServiceElevatorFloor
 			return true;
 
 		int count = clip->_endFrame - clip->_startFrame;
-		setMovieFrameRate(1.0 * count / fps);
-
 		int startFrame = clip->_startFrame + count * FACTORS[msg->_startFloor] / 100;
 		int endFrame = clip->_startFrame + count * FACTORS[msg->_endFloor] / 100;
+		double rate = (startFrame < endFrame ? 1.0 : -1.0) * count / fps;
 
 		if (_notifyFlag) {
 			// Service elevator indicator
 			playMovie(startFrame, endFrame, MOVIE_NOTIFY_OBJECT);
+			setMovieFrameRate(rate);
 		} else {
 			// Background outside elevator
 			playMovie(startFrame, endFrame, 0);
+			setMovieFrameRate(rate);
+
 			if (_intoSpace)
 				playClip("Into Space");
 		}
diff --git a/engines/titanic/support/avi_surface.cpp b/engines/titanic/support/avi_surface.cpp
index 0308465..97cc68f 100644
--- a/engines/titanic/support/avi_surface.cpp
+++ b/engines/titanic/support/avi_surface.cpp
@@ -147,8 +147,10 @@ bool AVISurface::startAtFrame(int frameNumber) {
 	seekToFrame(frameNumber);
 
 	// If we're in reverse playback, set the decoder to play in reverse
-	if (_isReversed)
+	if (_isReversed) {
+		_decoder->setReverse(true);
 		_decoder->setRate(Common::Rational(-1));
+	}
 
 	renderFrame();
 
@@ -436,6 +438,10 @@ bool AVISurface::addEvent(int *frameNumber, CGameObject *obj) {
 }
 
 void AVISurface::setFrameRate(double rate) {
+	// Assert that the decoder is already playing, since otherwise setting
+	// the decoder rate would prematurely start playback
+	assert(_decoder->isPlaying());
+
 	// Convert rate from fps to relative to 1.0 (normal speed)
 	const int PRECISION = 10000;
 	double playRate = rate / 15.0;	// Standard 15 FPS





More information about the Scummvm-git-logs mailing list