[Scummvm-cvs-logs] CVS: tools simon2mp3.c,1.2,1.3

Travis Howell kirben at users.sourceforge.net
Tue Nov 12 01:55:04 CET 2002


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

Modified Files:
	simon2mp3.c 
Log Message:

Add Possible simon2mp3 fix, patch #637005 
Remove tempfile.wav when encoding is finished


Index: simon2mp3.c
===================================================================
RCS file: /cvsroot/scummvm/tools/simon2mp3.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- simon2mp3.c	11 Nov 2002 17:54:59 -0000	1.2
+++ simon2mp3.c	12 Nov 2002 09:54:31 -0000	1.3
@@ -80,6 +80,7 @@
 	unlink(tmp);
 	unlink("tempfile.raw");
 	unlink(oggmode ? "tempfile.ogg" : "tempfile.mp3");
+	unlink("tempfile.wav");
 	
 	exit(0);
 }
@@ -168,10 +169,8 @@
 
 void get_wav(void) {
 	int length;
-	int i;
 	FILE *f;
 	char fbuf[2048];
-	char fbuf_o[4096];
 	int size;
 	char wavname[256];
 	char mp3name[256];
@@ -179,6 +178,7 @@
 	fseek(input, -4, SEEK_CUR);
 	length = get_int();
 	length += 8;
+	fseek(input, -8, SEEK_CUR);
 
 	sprintf(wavname, "tempfile.wav");
 	sprintf(mp3name, oggmode ? "tempfile.ogg" : "tempfile.mp3");
@@ -189,11 +189,7 @@
 		if (size <= 0)
 			break;
 		length -= size;
-		for (i = 0; i < size; i++) {
-			fbuf_o[2 * i] = fbuf[i] ^ 0x80;
-			fbuf_o[2 * i + 1] = 0;
-		}
-		fwrite(fbuf_o, 1, 2 * size, f);
+		fwrite(fbuf, 1, size, f);
 	}
 	fclose(f);
 





More information about the Scummvm-git-logs mailing list