[Scummvm-cvs-logs] SF.net SVN: scummvm: [28605] scummvm/trunk/engines/gob/coktelvideo.cpp

drmccoy at users.sourceforge.net drmccoy at users.sourceforge.net
Tue Aug 14 03:48:37 CEST 2007


Revision: 28605
          http://scummvm.svn.sourceforge.net/scummvm/?rev=28605&view=rev
Author:   drmccoy
Date:     2007-08-13 18:48:37 -0700 (Mon, 13 Aug 2007)

Log Message:
-----------
Fixed talking videos sync

Modified Paths:
--------------
    scummvm/trunk/engines/gob/coktelvideo.cpp

Modified: scummvm/trunk/engines/gob/coktelvideo.cpp
===================================================================
--- scummvm/trunk/engines/gob/coktelvideo.cpp	2007-08-14 00:42:32 UTC (rev 28604)
+++ scummvm/trunk/engines/gob/coktelvideo.cpp	2007-08-14 01:48:37 UTC (rev 28605)
@@ -949,7 +949,7 @@
 			if (_frames[i].parts[j].type == kPartTypeAudio) {
 
 				_frames[i].parts[j].flags = _stream->readByte();
-				_stream->skip(9); // Unknow
+				_stream->skip(9); // Unknown
 
 			} else if (_frames[i].parts[j].type == kPartTypeVideo) {
 
@@ -1093,11 +1093,17 @@
 			// Empty sound slice
 			} else if (part.flags == 3) {
 
-				if (_soundEnabled && (part.size > 0))
-					emptySoundSlice(part.size);
-				else
-					_stream->skip(part.size);
+				if (_soundEnabled) {
+					emptySoundSlice(_soundSliceSize);
 
+					if (_soundStage == 1)
+						startSound = true;
+				}
+
+				_stream->skip(part.size);
+			} else {
+				warning("Unknown sound part type %d", part.flags);
+				_stream->skip(part.size);
 			}
 
 		} else if (part.type == kPartTypeVideo) {
@@ -1256,23 +1262,18 @@
 }
 
 void Vmd::filledSoundSlices(uint32 size, uint32 mask) {
-	if (_soundBytesPerSample == 1) {
-		soundSlice8bit(size);
-		return;
-	}
+	int n = MIN<int>(_soundSlicesCount - 1, 31);
+	for (int i = 0; i < n; i++) {
 
-	for (int i = 0; i < (_soundSlicesCount - 1); i++) {
-
 		if (mask & 1)
-			emptySoundSlice(_soundSliceSize * 2);
-		else {
-			int16 init = _stream->readSint16LE();
-			soundSlice16bit(_soundSliceSize, init);
-		}
+			emptySoundSlice(_soundSliceSize * _soundBytesPerSample);
+		else
+			filledSoundSlice(_soundSliceSize);
 
 		mask >>= 1;
 	}
-
+	if (_soundSlicesCount > 32)
+		filledSoundSlice((_soundSlicesCount - 32) * _soundSliceSize);
 }
 
 void Vmd::deDPCM(byte *soundBuf, byte *dataBuf, int16 &init, uint32 n) {


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the Scummvm-git-logs mailing list