[Scummvm-git-logs] scummvm master -> 92320d616d47343a02e9cd0669491ceb68c07be7

bluegr noreply at scummvm.org
Tue Aug 22 10:18:19 UTC 2023


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
92320d616d COMMON: When flattening QuickTime edit lists, don't flatten non-silent audio chunks into silent chunks or vice versa.


Commit: 92320d616d47343a02e9cd0669491ceb68c07be7
    https://github.com/scummvm/scummvm/commit/92320d616d47343a02e9cd0669491ceb68c07be7
Author: elasota (ejlasota at gmail.com)
Date: 2023-08-22T13:18:15+03:00

Commit Message:
COMMON: When flattening QuickTime edit lists, don't flatten non-silent audio chunks into silent chunks or vice versa.

Fixes missing vidbot VO in Obsidian Japanese.

Changed paths:
    common/formats/quicktime.cpp


diff --git a/common/formats/quicktime.cpp b/common/formats/quicktime.cpp
index bc6f5a275f4..0fcdf4cd475 100644
--- a/common/formats/quicktime.cpp
+++ b/common/formats/quicktime.cpp
@@ -895,14 +895,35 @@ void QuickTimeParser::flattenEditLists() {
 	//
 	// Other players seem to just play the audio track chunks consecutively without the
 	// 30-sample skips, which produces the correct results, not sure why.
-
+	//
+	//
+	// We also need to account for mixed silent and non-silent tracks.  In Obsidian's
+	// Japanese localization, the vidbot that you talk to at the end of the maze (asset
+	// 4375) has a brief silent edit followed by the actual audio track.  If we
+	// collapse the audio track into the silent edit, then it causes the entire track
+	// to be silent.
 	for (Track *track : _tracks) {
-		if (track->editList.size()) {
-			EditListEntry &lastEntry = track->editList.back();
-			EditListEntry &firstEntry = track->editList.front();
-			firstEntry.trackDuration = (lastEntry.timeOffset + lastEntry.trackDuration);
+		if (track->editList.size() >= 2) {
+			Common::Array<EditListEntry> newEdits;
+
+			for (const EditListEntry &curEdit : track->editList) {
+				if (newEdits.size() == 0) {
+					newEdits.push_back(curEdit);
+					continue;
+				}
+
+				EditListEntry &prevEdit = newEdits.back();
+				bool prevIsSilent = (prevEdit.mediaTime == -1);
+				bool currentIsSilent = (curEdit.mediaTime == -1);
+
+				if (prevIsSilent != currentIsSilent) {
+					newEdits.push_back(curEdit);
+					continue;
+				} else
+					prevEdit.trackDuration += curEdit.trackDuration;
+			}
 
-			track->editList.resize(1);
+			track->editList = Common::move(newEdits);
 		}
 	}
 }




More information about the Scummvm-git-logs mailing list