changeset 9880:afa6ebcbb50d

fix i420 handling, bug found by rgselk at IRC <rgselknospam@yahoo.com>
author alex
date Tue, 08 Apr 2003 16:23:09 +0000
parents ea743bdf7e4d
children 60d1ccf22469
files vidix/drivers/mach64_vid.c
diffstat 1 files changed, 4 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/vidix/drivers/mach64_vid.c	Tue Apr 08 16:10:52 2003 +0000
+++ b/vidix/drivers/mach64_vid.c	Tue Apr 08 16:23:09 2003 +0000
@@ -791,10 +791,6 @@
 	config->offset.y= 0;
 	config->offset.u= (pitch*src_h + 15)&~15; 
 	config->offset.v= (config->offset.u + (pitch*src_h>>2) + 15)&~15;
-	
-	src_offset_y= config->offset.y + top*pitch + left;
-	src_offset_u= config->offset.u + (top*pitch>>2) + (left>>1);
-	src_offset_v= config->offset.v + (top*pitch>>2) + (left>>1);
 
 	if(besr.fourcc == IMGFMT_I420 || besr.fourcc == IMGFMT_IYUV)
 	{
@@ -803,6 +799,10 @@
 	  config->offset.u = config->offset.v;
 	  config->offset.v = tmp;
 	}
+		
+	src_offset_y= config->offset.y + top*pitch + left;
+	src_offset_u= config->offset.u + (top*pitch>>2) + (left>>1);
+	src_offset_v= config->offset.v + (top*pitch>>2) + (left>>1);
     }
     else if(besr.fourcc == IMGFMT_YVU9)
     {