[Scummvm-git-logs] scummvm master -> 22dd76e6a8e95b56e6686941298ad5c0e002bc61

SupSuper noreply at scummvm.org
Sat Jun 15 08:23:40 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:
7dacb67583 VIDEO: Add option to reset playback start time
22dd76e6a8 BAGEL: Fix frame skipping when videos are out of screen


Commit: 7dacb675839e29f2dfed343fe242782dd71830cd
    https://github.com/scummvm/scummvm/commit/7dacb675839e29f2dfed343fe242782dd71830cd
Author: SupSuper (supsuper at gmail.com)
Date: 2024-06-15T09:22:59+01:00

Commit Message:
VIDEO: Add option to reset playback start time

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


diff --git a/video/video_decoder.cpp b/video/video_decoder.cpp
index d66ef773cda..3e48dd736b9 100644
--- a/video/video_decoder.cpp
+++ b/video/video_decoder.cpp
@@ -923,6 +923,15 @@ void VideoDecoder::setEndFrame(uint frame) {
 	setEndTime(time);
 }
 
+void VideoDecoder::resetStartTime() {
+	if (_nextVideoTrack) {
+		Audio::Timestamp curTime = _nextVideoTrack->getFrameTime(_nextVideoTrack->getCurFrame());
+		if (isPlaying()) {
+			_startTime = g_system->getMillis() - (curTime.msecs() / _playbackRate).toInt();
+		}
+	}
+}
+
 VideoDecoder::Track *VideoDecoder::getTrack(uint track) {
 	if (track >= _internalTracks.size())
 		return 0;
diff --git a/video/video_decoder.h b/video/video_decoder.h
index f7e6c78922d..3818159d0d6 100644
--- a/video/video_decoder.h
+++ b/video/video_decoder.h
@@ -227,6 +227,11 @@ public:
 	 */
 	Audio::Timestamp getEndTime() const { return _endTime; }
 
+	/**
+	 * Reset the playback start time to the current frame.
+	 */
+	void resetStartTime();
+
 
 	/////////////////////////////////////////
 	// Playback Status


Commit: 22dd76e6a8e95b56e6686941298ad5c0e002bc61
    https://github.com/scummvm/scummvm/commit/22dd76e6a8e95b56e6686941298ad5c0e002bc61
Author: SupSuper (supsuper at gmail.com)
Date: 2024-06-15T09:23:00+01:00

Commit Message:
BAGEL: Fix frame skipping when videos are out of screen

Changed paths:
    engines/bagel/baglib/character_object.cpp
    engines/bagel/boflib/gui/movie.cpp


diff --git a/engines/bagel/baglib/character_object.cpp b/engines/bagel/baglib/character_object.cpp
index d9899ca23ac..5f85459a2cd 100644
--- a/engines/bagel/baglib/character_object.cpp
+++ b/engines/bagel/baglib/character_object.cpp
@@ -271,6 +271,7 @@ bool CBagCharacterObject::doAdvance() {
 
 				// Paint the current frame to the BMP
 				if (refreshCurrentFrame()) {
+					_smacker->resetStartTime();
 					// Get the current frame in the correct place
 					updatePosition();
 				}
diff --git a/engines/bagel/boflib/gui/movie.cpp b/engines/bagel/boflib/gui/movie.cpp
index ac568e684fa..6e85de47c79 100644
--- a/engines/bagel/boflib/gui/movie.cpp
+++ b/engines/bagel/boflib/gui/movie.cpp
@@ -173,7 +173,6 @@ void  CBofMovie::onMainLoop() {
 				onMovieDone();
 			} else {
 				seekToEnd();
-				//_pSmk->start();
 			}
 		} else {
 			setFrame(_pSmk->getCurFrame() - 2); // HACK: Reverse playback




More information about the Scummvm-git-logs mailing list