[Mplayer-cvslog] CVS: main/liba52 compare.c,1.1,1.2

Michael Niedermayer michael at mplayer.dev.hu
Sun Dec 16 14:24:17 CET 2001


Update of /cvsroot/mplayer/main/liba52
In directory mplayer:/var/tmp.root/cvs-serv17700

Modified Files:
	compare.c 
Log Message:
oops, 8bit instead of 16

Index: compare.c
===================================================================
RCS file: /cvsroot/mplayer/main/liba52/compare.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- compare.c	16 Dec 2001 00:31:44 -0000	1.1
+++ compare.c	16 Dec 2001 13:24:13 -0000	1.2
@@ -22,11 +22,16 @@
 	
 	for(;;)
 	{
-		int c0= fgetc(f0);
-		int c1= fgetc(f1);
-		int d= c0-c1;
-		if(c0<0 && c1<0) break;
-		if(c0<0 || c1<0)
+		short c0;
+		short c1;
+		int d;
+		
+		int e0= fread(&c0, 2, 1, f0);
+		int e1= fread(&c1, 2, 1, f1);
+		
+		d=c0-c1;
+		if(e0==0 && e1==0) break;
+		if(e0==0 || e1==0)
 		{
 			printf("FATAL error, files have different size!\n");
 			exit(1);
@@ -35,7 +40,7 @@
 		if(d<0) d=-d; // ABS
 		if(d>1)
 		{
-			printf("FATAL error, too large differnce found!\n");
+			printf("FATAL error, too large differnce found (%d)!\n", d);
 			exit(1);
 		}
 		




More information about the MPlayer-cvslog mailing list