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

sev- noreply at scummvm.org
Wed Aug 14 19:55:26 UTC 2024


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:
1a0913b626 TESTBED: Avoid extra delays when video decoding is slow
cbfc5d9ffc TESTBED: Adapt the video delay handling code for all platforms


Commit: 1a0913b626d0194b1cc0fb396d6cd431885bc126
    https://github.com/scummvm/scummvm/commit/1a0913b626d0194b1cc0fb396d6cd431885bc126
Author: Cameron Cawley (ccawley2011 at gmail.com)
Date: 2024-08-14T21:55:22+02:00

Commit Message:
TESTBED: Avoid extra delays when video decoding is slow

Changed paths:
    engines/testbed/video.cpp
    video/video_decoder.cpp
    video/video_decoder.h


diff --git a/engines/testbed/video.cpp b/engines/testbed/video.cpp
index d2563c60ecd..2531dae4e95 100644
--- a/engines/testbed/video.cpp
+++ b/engines/testbed/video.cpp
@@ -155,7 +155,7 @@ Common::Error Videotests::videoTest(Common::SeekableReadStream *stream, const Co
 				}
 			}
 			g_system->updateScreen();
-			g_system->delayMillis(10);
+			video->delayMillis(10);
 		}
 	}
 	video->close();
diff --git a/video/video_decoder.cpp b/video/video_decoder.cpp
index 3e48dd736b9..cafb229d049 100644
--- a/video/video_decoder.cpp
+++ b/video/video_decoder.cpp
@@ -112,6 +112,15 @@ bool VideoDecoder::needsUpdate() const {
 	return false;
 }
 
+void VideoDecoder::delayMillis(uint msecs) {
+	if (!needsUpdate())
+		g_system->delayMillis(MIN<uint>(msecs, getTimeToNextFrame()));
+#ifdef __DS__
+	else
+		g_system->delayMillis(0); /* This is needed to keep the mixer and timers active */
+#endif
+}
+
 void VideoDecoder::pauseVideo(bool pause) {
 	if (pause) {
 		_pauseLevel++;
diff --git a/video/video_decoder.h b/video/video_decoder.h
index 9d07f92968e..b2b3aca94f3 100644
--- a/video/video_decoder.h
+++ b/video/video_decoder.h
@@ -329,6 +329,12 @@ public:
 	 */
 	bool hasDirtyPalette() const { return _dirtyPalette; }
 
+	/**
+	 * Delay/sleep for the specified amount of milliseconds, or until the next
+	 * frame should be displayed.
+	 */
+	void delayMillis(uint msecs);
+
 	/**
 	 * Return the time (in ms) until the next frame should be displayed.
 	 */


Commit: cbfc5d9ffcf8712af2133c2975f4270750f4762d
    https://github.com/scummvm/scummvm/commit/cbfc5d9ffcf8712af2133c2975f4270750f4762d
Author: Filippos Karapetis (bluegr at gmail.com)
Date: 2024-08-14T21:55:22+02:00

Commit Message:
TESTBED: Adapt the video delay handling code for all platforms

Changed paths:
    video/video_decoder.cpp


diff --git a/video/video_decoder.cpp b/video/video_decoder.cpp
index cafb229d049..a4e9cc85e63 100644
--- a/video/video_decoder.cpp
+++ b/video/video_decoder.cpp
@@ -115,10 +115,8 @@ bool VideoDecoder::needsUpdate() const {
 void VideoDecoder::delayMillis(uint msecs) {
 	if (!needsUpdate())
 		g_system->delayMillis(MIN<uint>(msecs, getTimeToNextFrame()));
-#ifdef __DS__
 	else
-		g_system->delayMillis(0); /* This is needed to keep the mixer and timers active */
-#endif
+		g_system->delayMillis(1); /* This is needed to keep the mixer and timers active */
 }
 
 void VideoDecoder::pauseVideo(bool pause) {




More information about the Scummvm-git-logs mailing list