[Scummvm-cvs-logs] CVS: scummvm/scumm sound.cpp,1.484,1.485

Eugene Sandulenko sev at users.sourceforge.net
Thu Oct 20 19:01:11 CEST 2005


Update of /cvsroot/scummvm/scummvm/scumm
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30371/scumm

Modified Files:
	sound.cpp 
Log Message:
Fix MS IMA ADPCM decoder. I like Microsoft so much for reinventing another
standard.


Index: sound.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/sound.cpp,v
retrieving revision 1.484
retrieving revision 1.485
diff -u -d -r1.484 -r1.485
--- sound.cpp	20 Oct 2005 14:08:35 -0000	1.484
+++ sound.cpp	21 Oct 2005 02:00:12 -0000	1.485
@@ -308,18 +308,20 @@
 	// Support for later Backyard sports games sounds
 	else if (READ_UINT32(ptr) == MKID('RIFF')) {
 		uint16 type;
+		int blockAlign;
 		size = READ_LE_UINT32(ptr + 4);
 		Common::MemoryReadStream stream(ptr, size);
 
-		if (!loadWAVFromStream(stream, size, rate, flags, &type)) {
+		if (!loadWAVFromStream(stream, size, rate, flags, &type, &blockAlign)) {
 			error("playSound: Not a valid WAV file");
 		}
 
 		if (type == 17) {
-			AudioStream *voxStream = new ADPCMInputStream(&stream, size, kADPCMIma, (flags & Audio::Mixer::FLAG_STEREO) ? 2 : 1);
+			AudioStream *voxStream = new ADPCMInputStream(&stream, size, kADPCMIma, (flags & Audio::Mixer::FLAG_STEREO) ? 2 : 1, blockAlign);
 
 			sound = (char *)malloc(size * 4);
 			size = voxStream->readBuffer((int16*)sound, size * 2);
+			size *= 2; // 16bits.
 		} else {
 			// Allocate a sound buffer, copy the data into it, and play
 			sound = (char *)malloc(size);





More information about the Scummvm-git-logs mailing list