[Scummvm-git-logs] scummvm master -> ed82ccb95bd0d7909ad8f6ca6000e81505e01752

sev- sev at scummvm.org
Wed Aug 19 22:53:39 UTC 2020


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:
6889c7e720 DIRECTOR: Do not render stopped videos
ed82ccb95b BACKENDS: More mutexes


Commit: 6889c7e7202e4c81a952a739428062fc235b7425
    https://github.com/scummvm/scummvm/commit/6889c7e7202e4c81a952a739428062fc235b7425
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2020-08-20T00:53:23+02:00

Commit Message:
DIRECTOR: Do not render stopped videos

Changed paths:
    engines/director/castmember.cpp


diff --git a/engines/director/castmember.cpp b/engines/director/castmember.cpp
index 105145b465..535261eea3 100644
--- a/engines/director/castmember.cpp
+++ b/engines/director/castmember.cpp
@@ -308,7 +308,7 @@ bool DigitalVideoCastMember::loadVideo(Common::String path) {
 }
 
 bool DigitalVideoCastMember::isModified() {
-	if (!_video || !_video->isVideoLoaded())
+	if (!_video || !_video->isVideoLoaded() || _channel->_movieRate == 0.0)
 		return false;
 
 	return _video->needsUpdate();
@@ -319,13 +319,17 @@ Graphics::MacWidget *DigitalVideoCastMember::createWidget(Common::Rect &bbox, Ch
 
 	_channel = channel;
 
+	// Do not render stopped videos
+	if (_channel->_movieRate == 0.0)
+		return nullptr;
+
 	if (!_video || !_video->isVideoLoaded()) {
 		warning("DigitalVideoCastMember::createWidget: No video decoder");
 		return nullptr;
 	}
 
 	// FIXME: HACK: We need to understand when really start the video
-	if (!_video->isPlaying() && _channel->_movieRate != 0.0) {
+	if (!_video->isPlaying()) {
 		_video->start();
 		debugC(2, kDebugImages, "STARTING VIDEO %s", _filename.c_str());
 


Commit: ed82ccb95bd0d7909ad8f6ca6000e81505e01752
    https://github.com/scummvm/scummvm/commit/ed82ccb95bd0d7909ad8f6ca6000e81505e01752
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2020-08-20T00:53:23+02:00

Commit Message:
BACKENDS: More mutexes

Changed paths:
    audio/mixer.cpp
    audio/mixer_intern.h
    backends/platform/sdl/sdl.cpp
    backends/timer/default/default-timer.cpp
    backends/timer/sdl/sdl-timer.cpp


diff --git a/audio/mixer.cpp b/audio/mixer.cpp
index 9eb3e6714a..beda136acf 100644
--- a/audio/mixer.cpp
+++ b/audio/mixer.cpp
@@ -187,6 +187,8 @@ MixerImpl::~MixerImpl() {
 }
 
 void MixerImpl::setReady(bool ready) {
+	Common::StackLock lock(_mutex);
+
 	_mixerReady = ready;
 }
 
diff --git a/audio/mixer_intern.h b/audio/mixer_intern.h
index 9cb7fa0e9e..aed57eb835 100644
--- a/audio/mixer_intern.h
+++ b/audio/mixer_intern.h
@@ -76,7 +76,7 @@ public:
 	MixerImpl(uint sampleRate);
 	~MixerImpl();
 
-	virtual bool isReady() const { return _mixerReady; }
+	virtual bool isReady() const { Common::StackLock lock(_mutex); return _mixerReady; }
 
 	virtual void playStream(
 		SoundType type,
diff --git a/backends/platform/sdl/sdl.cpp b/backends/platform/sdl/sdl.cpp
index aad301ea87..250a6775b7 100644
--- a/backends/platform/sdl/sdl.cpp
+++ b/backends/platform/sdl/sdl.cpp
@@ -784,4 +784,3 @@ char *OSystem_SDL::convertEncoding(const char *to, const char *from, const char
 	return ModularBackend::convertEncoding(to, from, string, length);
 #endif // SDL_VERSION_ATLEAST(1, 2, 10)
 }
-
diff --git a/backends/timer/default/default-timer.cpp b/backends/timer/default/default-timer.cpp
index 22cb418ba0..02f1f0ed8e 100644
--- a/backends/timer/default/default-timer.cpp
+++ b/backends/timer/default/default-timer.cpp
@@ -69,15 +69,8 @@ DefaultTimerManager::DefaultTimerManager() :
 }
 
 DefaultTimerManager::~DefaultTimerManager() {
-#ifdef DIRECTORBUILDBOT
-	warning("~DefaultTimerManager");
-#endif
 	Common::StackLock lock(_mutex);
 
-#ifdef DIRECTORBUILDBOT
-	warning("~DefaultTimerManager: locked");
-#endif
-
 	TimerSlot *slot = _head;
 	while (slot) {
 		TimerSlot *next = slot->next;
@@ -85,20 +78,10 @@ DefaultTimerManager::~DefaultTimerManager() {
 		slot = next;
 	}
 	_head = 0;
-
-#ifdef DIRECTORBUILDBOT
-	warning("~DefaultTimerManager: completed");
-#endif
 }
 
 void DefaultTimerManager::handler() {
-#ifdef DIRECTORBUILDBOT
-	warning("DefaultTimerManager::handler(): locking");
-#endif
 	Common::StackLock lock(_mutex);
-#ifdef DIRECTORBUILDBOT
-	warning("DefaultTimerManager::handler(): locked");
-#endif
 
 	uint32 curTime = g_system->getMillis(true);
 
diff --git a/backends/timer/sdl/sdl-timer.cpp b/backends/timer/sdl/sdl-timer.cpp
index 235fb904e3..7cceb2755e 100644
--- a/backends/timer/sdl/sdl-timer.cpp
+++ b/backends/timer/sdl/sdl-timer.cpp
@@ -29,19 +29,10 @@
 
 #include "common/textconsole.h"
 
-static volatile bool timerInstalled = false;
+OSystem::MutexRef timerMutex;
 
 static Uint32 timer_handler(Uint32 interval, void *param) {
-	if (!timerInstalled) {
-#ifdef DIRECTORBUILDBOT
-		warning("timer_handler: timer is not installed");
-#endif
-		return interval;
-	}
-
-#ifdef DIRECTORBUILDBOT
-	warning("timer_handler: called");
-#endif
+	Common::StackLock lock(timerMutex);
 
 	((DefaultTimerManager *)param)->handler();
 	return interval;
@@ -53,23 +44,15 @@ SdlTimerManager::SdlTimerManager() {
 		error("Could not initialize SDL: %s", SDL_GetError());
 	}
 
-	timerInstalled = true;
-
 	// Creates the timer callback
 	_timerID = SDL_AddTimer(10, &timer_handler, this);
 }
 
 SdlTimerManager::~SdlTimerManager() {
-#ifdef DIRECTORBUILDBOT
-	warning("~SdlTimerManager");
-#endif
-	timerInstalled = false;
+	Common::StackLock lock(timerMutex);
+
 	// Removes the timer callback
 	SDL_RemoveTimer(_timerID);
-
-#ifdef DIRECTORBUILDBOT
-	warning("~SdlTimerManager: SDL timer removed");
-#endif
 }
 
 #endif




More information about the Scummvm-git-logs mailing list