[Scummvm-cvs-logs] CVS: scummvm sound.cpp,1.81,1.82

James Brown ender at users.sourceforge.net
Tue May 7 04:49:01 CEST 2002


Update of /cvsroot/scummvm/scummvm
In directory usw-pr-cvs1:/tmp/cvs-serv10526

Modified Files:
	sound.cpp 
Log Message:
Added rate detection for The Dig - solves problems with other language versions.


Index: sound.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/sound.cpp,v
retrieving revision 1.81
retrieving revision 1.82
diff -u -d -r1.81 -r1.82
--- sound.cpp	6 May 2002 15:32:32 -0000	1.81
+++ sound.cpp	7 May 2002 11:48:34 -0000	1.82
@@ -760,6 +760,7 @@
 	}
 
 	{	/* Parse decompressed data */
+		int rate = 22050;
 		byte *ptr = CompFinal;
 		int tag, size;
 		tag = READ_BE_UINT32(ptr); ptr+=4;
@@ -770,10 +771,13 @@
 		}
 
 		ptr+=12;       /* Skip header */
-		while(tag != MKID_BE('DATA')) {
+		while(tag != MKID_BE('DATA')) {			
 			tag = READ_BE_UINT32(ptr);  ptr+=4;
 			switch(tag) {
-				case MKID_BE('FRMT'):
+				case MKID_BE('FRMT'): 
+					size = READ_BE_UINT32(ptr); ptr+=16;					
+					rate = READ_BE_UINT32(ptr); ptr+=8;
+				break;
 				case MKID_BE('TEXT'):
 				case MKID_BE('REGN'):
 				case MKID_BE('STOP'):
@@ -791,7 +795,7 @@
 
 		Final = (unsigned char *)malloc(size);
 		memcpy(&Final[0], &ptr[0], size);
-		_mixer->play_raw(NULL, Final, size, 22050, SoundMixer::FLAG_UNSIGNED | SoundMixer::FLAG_AUTOFREE);
+		_mixer->play_raw(NULL, Final, size, rate, SoundMixer::FLAG_UNSIGNED | SoundMixer::FLAG_AUTOFREE);
 		free(CompFinal);
 	}
 }





More information about the Scummvm-git-logs mailing list