changeset 4351:aac822b8a630

fixed i420 handling
author alex
date Sat, 26 Jan 2002 15:46:58 +0000
parents 70ac7ab2a982
children ed5b85b713a3
files libvo/vo_xv.c
diffstat 1 files changed, 10 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/libvo/vo_xv.c	Sat Jan 26 15:43:31 2002 +0000
+++ b/libvo/vo_xv.c	Sat Jan 26 15:46:58 2002 +0000
@@ -566,8 +566,16 @@
 
      // YV12 planar
      memcpy(xvimage[current_buf]->data,src[0],image_width*image_height);
-     memcpy(xvimage[current_buf]->data+image_width*image_height,src[2],image_width*image_height/4);
-     memcpy(xvimage[current_buf]->data+image_width*image_height*5/4,src[1],image_width*image_height/4);
+     if (xv_format == IMGFMT_YV12)
+     {
+        memcpy(xvimage[current_buf]->data+image_width*image_height,src[2],image_width*image_height/4);
+        memcpy(xvimage[current_buf]->data+image_width*image_height*5/4,src[1],image_width*image_height/4);
+     }
+     else
+     {
+        memcpy(xvimage[current_buf]->data+image_width*image_height,src[1],image_width*image_height/4);
+        memcpy(xvimage[current_buf]->data+image_width*image_height*5/4,src[2],image_width*image_height/4);
+     }
      break;
  }