[Mplayer-cvslog] CVS: main/postproc swscale.c,1.67,1.68

Michael Niedermayer michael at mplayer.dev.hu
Mon Feb 4 19:53:06 CET 2002


Update of /cvsroot/mplayer/main/postproc
In directory mplayer:/var/tmp.root/cvs-serv13078

Modified Files:
	swscale.c 
Log Message:
printing error messages if something is wrong instead of just return NULL;


Index: swscale.c
===================================================================
RCS file: /cvsroot/mplayer/main/postproc/swscale.c,v
retrieving revision 1.67
retrieving revision 1.68
diff -u -r1.67 -r1.68
--- swscale.c	3 Feb 2002 02:08:05 -0000	1.67
+++ swscale.c	4 Feb 2002 18:53:01 -0000	1.68
@@ -1127,11 +1127,24 @@
 	if(srcFormat==IMGFMT_Y8)   srcFormat=IMGFMT_Y800;
 	if(dstFormat==IMGFMT_Y8)   dstFormat=IMGFMT_Y800;
 
-	if(!isSupportedIn(srcFormat)) return NULL;
-	if(!isSupportedOut(dstFormat)) return NULL;
+	if(!isSupportedIn(srcFormat)) 
+	{
+		fprintf(stderr, "swScaler: %s is not supported as input format\n", vo_format_name(srcFormat));
+		return NULL;
+	}
+	if(!isSupportedOut(dstFormat))
+	{
+		fprintf(stderr, "swScaler: %s is not supported as output format\n", vo_format_name(dstFormat));
+		return NULL;
+	}
 
 	/* sanity check */
-	if(srcW<4 || srcH<1 || dstW<8 || dstH<1) return NULL; //FIXME check if these are enough and try to lowwer them after fixing the relevant parts of the code
+	if(srcW<4 || srcH<1 || dstW<8 || dstH<1) //FIXME check if these are enough and try to lowwer them after fixing the relevant parts of the code
+	{
+		fprintf(stderr, "swScaler: %dx%d -> %dx%d is invalid scaling dimension\n", 
+			srcW, srcH, dstW, dstH);
+		return NULL;
+	}
 
 	if(!dstFilter) dstFilter= &dummyFilter;
 	if(!srcFilter) srcFilter= &dummyFilter;




More information about the MPlayer-cvslog mailing list