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

dreammaster dreammaster at scummvm.org
Fri Dec 30 04:27:21 CET 2016


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:
2e8c80cf58 VIDEO: Add support for AVI 2-track videos with missing track 2 indexes
cc4ede6509 VIDEO: Further work on 2-track AVI videos


Commit: 2e8c80cf58e03ad735a5b147f11d31f07e49e33a
    https://github.com/scummvm/scummvm/commit/2e8c80cf58e03ad735a5b147f11d31f07e49e33a
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-12-29T16:54:13-05:00

Commit Message:
VIDEO: Add support for AVI 2-track videos with missing track 2 indexes

Changed paths:
    video/avi_decoder.cpp


diff --git a/video/avi_decoder.cpp b/video/avi_decoder.cpp
index fc73cfa..c2c485c 100644
--- a/video/avi_decoder.cpp
+++ b/video/avi_decoder.cpp
@@ -721,18 +721,31 @@ bool AVIDecoder::seekIntern(const Audio::Timestamp &time) {
 		AVIVideoTrack *videoTrack2 = static_cast<AVIVideoTrack *>(_videoTracks.back().track);
 		videoTrack2->setCurFrame((int)frame - 1);
 
-		// Find the index entry for the frame and read it in
-		OldIndex *entry = _indexEntries.find(_videoTracks.back().index, frame);
+		// Find the index entry for the frame
+		int indexFrame = frame;
+		OldIndex *entry = nullptr;
+		do {
+			entry = _indexEntries.find(_videoTracks.back().index, indexFrame);
+		} while (!entry && --indexFrame >= 0);
 		assert(entry);
 
+		// Read in the frame
 		Common::SeekableReadStream *chunk = nullptr;
 		_fileStream->seek(entry->offset + 8);
 		_videoTracks.back().chunkSearchOffset = entry->offset;
 
 		if (entry->size != 0)
 			chunk = _fileStream->readStream(entry->size);
-
 		videoTrack2->decodeFrame(chunk);
+
+		if (indexFrame < frame) {
+			TrackStatus &status = _videoTracks.back();
+			while (indexFrame++ < frame) {
+				// There was no index entry for the desired frame, so an earlier one was decoded.
+				// We now have to sequentially decode frames until we get to the desired frame
+				handleNextPacket(status);
+			}
+		}
 	}
 
 	// Set the video track's frame


Commit: cc4ede6509bb12a5d60861eb925640601fab6020
    https://github.com/scummvm/scummvm/commit/cc4ede6509bb12a5d60861eb925640601fab6020
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-12-29T22:23:16-05:00

Commit Message:
VIDEO: Further work on 2-track AVI videos

It turns out that at least one video in Starship Titanic, for the
Lift Indicator, has only a single transparency frame in track 2.
The added code, therefore, when it doesn't find an index entry
for the desired frame number, works backwards until it finds a valid
frame (likely frame 0), and then scans forward. If it hits the end
of the video, then it simply uses whatever last frame it last decoded.

Changed paths:
    video/avi_decoder.cpp


diff --git a/video/avi_decoder.cpp b/video/avi_decoder.cpp
index c2c485c..32aa9f9 100644
--- a/video/avi_decoder.cpp
+++ b/video/avi_decoder.cpp
@@ -726,7 +726,7 @@ bool AVIDecoder::seekIntern(const Audio::Timestamp &time) {
 		OldIndex *entry = nullptr;
 		do {
 			entry = _indexEntries.find(_videoTracks.back().index, indexFrame);
-		} while (!entry && --indexFrame >= 0);
+		} while (!entry && indexFrame-- > 0);
 		assert(entry);
 
 		// Read in the frame
@@ -740,7 +740,7 @@ bool AVIDecoder::seekIntern(const Audio::Timestamp &time) {
 
 		if (indexFrame < frame) {
 			TrackStatus &status = _videoTracks.back();
-			while (indexFrame++ < frame) {
+			while (status.chunkSearchOffset < _movieListEnd && indexFrame++ < frame) {
 				// There was no index entry for the desired frame, so an earlier one was decoded.
 				// We now have to sequentially decode frames until we get to the desired frame
 				handleNextPacket(status);





More information about the Scummvm-git-logs mailing list