changeset 8490:ac40496c7d9e

1000l! I have no idea how this code worked at all before. I guess no one tests win32 much anyway... :)
author rfelker
date Wed, 18 Dec 2002 07:34:32 +0000
parents 2dd791127398
children ce25d80dd6c3
files libvo/vo_directx.c
diffstat 1 files changed, 6 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/libvo/vo_directx.c	Tue Dec 17 10:38:48 2002 +0000
+++ b/libvo/vo_directx.c	Wed Dec 18 07:34:32 2002 +0000
@@ -996,7 +996,7 @@
 {
 	uint8_t *s;
     uint8_t *d;
-    uint32_t i=0;
+    uint32_t i=0, uvstride=dstride/2;
     
 	// copy Y
     d=image+dstride*y+x;                
@@ -1004,29 +1004,29 @@
     for(i=0;i<h;i++){
         memcpy(d,s,w);                  
         s+=stride[0];                  
-        d+=stride[0];
+        d+=dstride;
     }
     
 	w/=2;h/=2;x/=2;y/=2;
 	
 	// copy U
-    d=image+image_width*image_height + dstride*y/2+x;
+    d=image+dstride*image_height + uvstride*y+x;
     if(swap)s=src[2];
 	else s=src[1];
     for(i=0;i<h;i++){
         memcpy(d,s,w);
         s+=stride[1];
-        d+=stride[1];
+        d+=uvstride;
     }
 	
 	// copy V
-    d=image+image_width*image_height +image_width*image_height/4 + dstride*y/2+x;
+    d=image+dstride*image_height +uvstride*(image_height/2) + uvstride*y+x;
     if(swap)s=src[1];
 	else s=src[2];
     for(i=0;i<h;i++){
         memcpy(d,s,w);
         s+=stride[2];
-        d+=stride[2];
+        d+=uvstride;
     }
     return 0;
 }