[Scummvm-git-logs] scummvm master -> 156ba82247ff2c99fe7cd56c54e7b393c434944e

sev- noreply at scummvm.org
Fri Apr 14 14:46:54 UTC 2023


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:
1e877bab26 VIDEO: Support quicktime reverse playback with multiple edits
156ba82247 VIDEO: Add support for custom rate in quicktime videos


Commit: 1e877bab26ac3e101788817372f09fc2c0a080a3
    https://github.com/scummvm/scummvm/commit/1e877bab26ac3e101788817372f09fc2c0a080a3
Author: Harishankar Kumar (hari01584 at gmail.com)
Date: 2023-04-14T16:46:49+02:00

Commit Message:
VIDEO: Support quicktime reverse playback with multiple edits

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


diff --git a/video/qt_decoder.cpp b/video/qt_decoder.cpp
index 710fed87882..1236f342ca1 100644
--- a/video/qt_decoder.cpp
+++ b/video/qt_decoder.cpp
@@ -499,6 +499,20 @@ const Graphics::Surface *QuickTimeDecoder::VideoTrackHandler::decodeNextFrame()
 		return 0;
 
 	if (_reversed) {
+		if (beforeCurEdit()) {
+			_curEdit--;
+
+			if (atFirstEdit()) {
+				return 0;
+			}
+
+			enterNewEditListEntry(false);
+			
+			if (isEmptyEdit()) {
+				return 0;
+			}
+		}
+
 		// Subtract one to place us on the frame before the current displayed frame.
 		_curFrame--;
 
@@ -885,10 +899,20 @@ uint32 QuickTimeDecoder::VideoTrackHandler::getCurEditTrackDuration() const {
 	return _parent->editList[_curEdit].trackDuration * _parent->timeScale / _decoder->_timeScale;
 }
 
+bool QuickTimeDecoder::VideoTrackHandler::atFirstEdit() const {
+    return _curEdit == 0;
+}
+
 bool QuickTimeDecoder::VideoTrackHandler::atLastEdit() const {
 	return _curEdit == _parent->editList.size();
 }
 
+bool QuickTimeDecoder::VideoTrackHandler::beforeCurEdit() const {
+    // We're at the end of the edit once the next frame's time would
+    // bring us past the end of the edit.
+    return getRateAdjustedFrameTime() <= getCurEditTimeOffset();
+}
+
 bool QuickTimeDecoder::VideoTrackHandler::endOfCurEdit() const {
 	// We're at the end of the edit once the next frame's time would
 	// bring us past the end of the edit.
diff --git a/video/qt_decoder.h b/video/qt_decoder.h
index d6766ed8b9e..4be74038fbc 100644
--- a/video/qt_decoder.h
+++ b/video/qt_decoder.h
@@ -179,7 +179,9 @@ private:
 		uint32 getRateAdjustedFrameTime() const; // media time
 		uint32 getCurEditTimeOffset() const;     // media time
 		uint32 getCurEditTrackDuration() const;  // media time
+		bool atFirstEdit() const;
 		bool atLastEdit() const;
+		bool beforeCurEdit() const;
 		bool endOfCurEdit() const;
 		void checkEditListBounds();
 	};


Commit: 156ba82247ff2c99fe7cd56c54e7b393c434944e
    https://github.com/scummvm/scummvm/commit/156ba82247ff2c99fe7cd56c54e7b393c434944e
Author: Harishankar Kumar (hari01584 at gmail.com)
Date: 2023-04-14T16:46:49+02:00

Commit Message:
VIDEO: Add support for custom rate in quicktime videos

used in mediaband undome

Changed paths:
    video/qt_decoder.cpp


diff --git a/video/qt_decoder.cpp b/video/qt_decoder.cpp
index 1236f342ca1..555f3d3a3a3 100644
--- a/video/qt_decoder.cpp
+++ b/video/qt_decoder.cpp
@@ -498,6 +498,11 @@ const Graphics::Surface *QuickTimeDecoder::VideoTrackHandler::decodeNextFrame()
 	if (endOfTrack())
 		return 0;
 
+	// Playback rate logic, if rate != -1 then seek to our rate adjusted time!
+	if (_decoder->getRate() != 1 && _decoder->getRate() != -1) {
+		seek(_decoder->getTime());
+	}
+
 	if (_reversed) {
 		if (beforeCurEdit()) {
 			_curEdit--;




More information about the Scummvm-git-logs mailing list