[Scummvm-cvs-logs] CVS: tools extract-common.c,1.9,1.10 extract.c,1.39,1.40 extract.h,1.11,1.12 simon2mp3.c,1.33,1.34

Max Horn fingolfin at users.sourceforge.net
Sat Apr 10 14:35:03 CEST 2004


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

Modified Files:
	extract-common.c extract.c extract.h simon2mp3.c 
Log Message:
cleanup

Index: extract-common.c
===================================================================
RCS file: /cvsroot/scummvm/tools/extract-common.c,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -d -r1.9 -r1.10
--- extract-common.c	10 Apr 2004 01:47:13 -0000	1.9
+++ extract-common.c	10 Apr 2004 21:20:56 -0000	1.10
@@ -146,7 +146,7 @@
 	}
 } 
 
-void get_wav(FILE *input, CompressMode compMode) {
+void extractAndEncodeWAV(const char *outName, FILE *input, CompressMode compMode) {
 	int length;
 	FILE *f;
 	char fbuf[2048];
@@ -158,7 +158,7 @@
 	fseek(input, -8, SEEK_CUR);
 
 	/* Copy the WAV data to a temporary file */
-	f = fopen(TEMP_WAV, "wb");
+	f = fopen(outName, "wb");
 	while (length > 0) {
 		size = fread(fbuf, 1, length > sizeof(fbuf) ? sizeof(fbuf) : length, input);
 		if (size <= 0)
@@ -169,17 +169,18 @@
 	fclose(f);
 
 	/* Convert the WAV temp file to OGG/MP3 */
-	encodeAudio(TEMP_WAV, false, -1, tempEncoded, compMode);
+	encodeAudio(outName, false, -1, tempEncoded, compMode);
 }
 
-void get_voc(FILE *input, CompressMode compMode) {
+void extractAndEncodeVOC(const char *outName, FILE *input, CompressMode compMode) {
 	int blocktype;
 
-// FIXME HIGH PRIORITY: We aren't handling all types of blocks, and what is
-// worse, we aren't handling multiple blocks occuring in a single VOC file.
-// This is bad, because multiple type 1 blocks occur in Full Throttle.
-// As a result of this lacking feature, we generates compressed audio files
-// which are missing some data. Ouch! See also bug #885490
+/* FIXME HIGH PRIORITY: We aren't handling all types of blocks, and what is
+   worse, we aren't handling multiple blocks occuring in a single VOC file.
+   This is bad, because multiple type 1 blocks occur in Full Throttle.
+   As a result of this lacking feature, we generates compressed audio files
+   which are missing some data. Ouch! See also bug #885490
+ */
 
 	blocktype = fgetc(input);
 	switch (blocktype) {
@@ -216,7 +217,7 @@
 			error("Cannot handle compressed VOC data");
 
 		/* Copy the raw data to a temporary file */
-		f = fopen(TEMP_RAW, "wb");
+		f = fopen(outName, "wb");
 		while (length > 0) {
 			size = fread(fbuf, 1, length > sizeof(fbuf) ? sizeof(fbuf) : (uint32)length, input);
 			if (size <= 0)
@@ -227,7 +228,7 @@
 		fclose(f);
 
 		/* Convert the raw temp file to OGG/MP3 */
-		encodeAudio(TEMP_RAW, true, real_samplerate, tempEncoded, compMode);
+		encodeAudio(outName, true, real_samplerate, tempEncoded, compMode);
 		break;
 	}
 

Index: extract.c
===================================================================
RCS file: /cvsroot/scummvm/tools/extract.c,v
retrieving revision 1.39
retrieving revision 1.40
diff -u -d -r1.39 -r1.40
--- extract.c	10 Apr 2004 00:37:21 -0000	1.39
+++ extract.c	10 Apr 2004 21:20:57 -0000	1.40
@@ -129,7 +129,7 @@
 	printf("Voice file found (pos = %d) :", pos);
 
 	/* Conver the VOC data */
-	get_voc(input, gCompMode);
+	extractAndEncodeVOC(TEMP_RAW, input, gCompMode);
 	
 	/* Append the converted data to the master output file */
 	sprintf(outname, tempEncoded);

Index: extract.h
===================================================================
RCS file: /cvsroot/scummvm/tools/extract.h,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -d -r1.11 -r1.12
--- extract.h	10 Apr 2004 00:37:21 -0000	1.11
+++ extract.h	10 Apr 2004 21:20:57 -0000	1.12
@@ -52,8 +52,8 @@
 extern void process_ogg_parms(int argc, char *argv[], int i);
 extern void process_flac_parms(int argc, char *argv[], int i);
 
-extern void get_voc(FILE *input, CompressMode compMode);
-extern void get_wav(FILE *input, CompressMode compMode);
+extern void extractAndEncodeVOC(const char *outName, FILE *input, CompressMode compMode);
+extern void extractAndEncodeWAV(const char *outName, FILE *input, CompressMode compMode);
 
 
 /*

Index: simon2mp3.c
===================================================================
RCS file: /cvsroot/scummvm/tools/simon2mp3.c,v
retrieving revision 1.33
retrieving revision 1.34
diff -u -d -r1.33 -r1.34
--- simon2mp3.c	10 Apr 2004 00:37:21 -0000	1.33
+++ simon2mp3.c	10 Apr 2004 21:20:57 -0000	1.34
@@ -125,10 +125,10 @@
 	if (!memcmp(buf, "Creative", 8)) {
 		printf("VOC found (pos = %d) :\n", offset);
 		fseek(input, 18, SEEK_CUR);
-		get_voc(input, gCompMode);
+		extractAndEncodeVOC(TEMP_RAW, input, gCompMode);
 	} else if (!memcmp(buf, "RIFF", 4)) {
 		printf("WAV found (pos = %d) :\n", offset);
-		get_wav(input, gCompMode);
+		extractAndEncodeWAV(TEMP_WAV, input, gCompMode);
 	} else {
 		error("Unexpected data at offset: %i", offset);
 	}





More information about the Scummvm-git-logs mailing list