[Scummvm-git-logs] scummvm master -> 3d8523a86eb60c8486130091baa7261c89cc27a6

moralrecordings code at moral.net.au
Sun May 30 11:40:01 UTC 2021


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

Summary:
8836857b1b DIRECTOR: Stop playing videos after the sprite changes
3d8523a86e DIRECTOR: Continue playing videos even if they are audio-only


Commit: 8836857b1b9813e47b75a265dc2acca02e9de01e
    https://github.com/scummvm/scummvm/commit/8836857b1b9813e47b75a265dc2acca02e9de01e
Author: Scott Percival (code at moral.net.au)
Date: 2021-05-30T19:29:16+08:00

Commit Message:
DIRECTOR: Stop playing videos after the sprite changes

Changed paths:
    engines/director/castmember.cpp
    engines/director/castmember.h
    engines/director/channel.cpp


diff --git a/engines/director/castmember.cpp b/engines/director/castmember.cpp
index de41890cf8..9728828901 100644
--- a/engines/director/castmember.cpp
+++ b/engines/director/castmember.cpp
@@ -366,6 +366,12 @@ void DigitalVideoCastMember::startVideo(Channel *channel) {
 	_duration = getMovieTotalTime();
 }
 
+void DigitalVideoCastMember::stopVideo(Channel *channel) {
+	_video->stop();
+
+	debugC(2, kDebugImages, "STOPPING VIDEO %s", _filename.c_str());
+}
+
 Graphics::MacWidget *DigitalVideoCastMember::createWidget(Common::Rect &bbox, Channel *channel) {
 	Graphics::MacWidget *widget = new Graphics::MacWidget(g_director->getCurrentWindow(), bbox.left, bbox.top, bbox.width(), bbox.height(), g_director->_wm, false);
 
diff --git a/engines/director/castmember.h b/engines/director/castmember.h
index 91a1d196b0..55d2a6a0e9 100644
--- a/engines/director/castmember.h
+++ b/engines/director/castmember.h
@@ -142,6 +142,7 @@ public:
 
 	bool loadVideo(Common::String path);
 	void startVideo(Channel *channel);
+	void stopVideo(Channel *channel);
 
 	uint getMovieCurrentTime();
 	uint getMovieTotalTime();
diff --git a/engines/director/channel.cpp b/engines/director/channel.cpp
index 062d04f4d4..be97f6c61a 100644
--- a/engines/director/channel.cpp
+++ b/engines/director/channel.cpp
@@ -291,6 +291,16 @@ void Channel::setClean(Sprite *nextSprite, int spriteId, bool partial) {
 			}
 		}
 
+		// If the previous sprite in this channel was a video, but the new sprite is different,
+		// stop the playback.
+		// TODO: In D4 *any* channels playing the same cast member across a frame change seems
+		// to be enough to keep the same playback going, but the behaviour seems too glitchy
+		// to be reliable? Hopefully nothing relies on this.
+		if (_sprite && _sprite->_cast && _sprite->_cast->_type == kCastDigitalVideo &&
+				_sprite->_castId != nextSprite->_castId) {
+			((DigitalVideoCastMember *)_sprite->_cast)->stopVideo(this);
+		}
+
 		if (_sprite->_puppet || partial) {
 			// Updating scripts, etc. does not require a full re-render
 			_sprite->_scriptId = nextSprite->_scriptId;


Commit: 3d8523a86eb60c8486130091baa7261c89cc27a6
    https://github.com/scummvm/scummvm/commit/3d8523a86eb60c8486130091baa7261c89cc27a6
Author: Scott Percival (code at moral.net.au)
Date: 2021-05-30T19:29:16+08:00

Commit Message:
DIRECTOR: Continue playing videos even if they are audio-only

Changed paths:
    engines/director/castmember.cpp


diff --git a/engines/director/castmember.cpp b/engines/director/castmember.cpp
index 9728828901..879a0f8732 100644
--- a/engines/director/castmember.cpp
+++ b/engines/director/castmember.cpp
@@ -334,7 +334,7 @@ bool DigitalVideoCastMember::isModified() {
 	if (!_video || !_video->isVideoLoaded())
 		return true;
 
-	if (_getFirstFrame)
+	if (_video->isPlaying())
 		return true;
 
 	if (_channel->_movieRate == 0.0)




More information about the Scummvm-git-logs mailing list