[Mplayer-cvslog] CVS: main/libvo vo_xv.c,1.65,1.66

Arpi of Ize arpi at mplayer.dev.hu
Sun Mar 24 20:14:43 CET 2002


Update of /cvsroot/mplayer/main/libvo
In directory mplayer:/var/tmp.root/cvs-serv29614

Modified Files:
	vo_xv.c 
Log Message:
I420 UV swapping fixed

Index: vo_xv.c
===================================================================
RCS file: /cvsroot/mplayer/main/libvo/vo_xv.c,v
retrieving revision 1.65
retrieving revision 1.66
diff -u -r1.65 -r1.66
--- vo_xv.c	24 Mar 2002 18:19:14 -0000	1.65
+++ vo_xv.c	24 Mar 2002 19:14:40 -0000	1.66
@@ -620,7 +620,8 @@
 
  x/=2;y/=2;w/=2;h/=2;
 
- dst = xvimage[current_buf]->data + image_width * image_height + image_width/2 * y + x;
+ dst = xvimage[current_buf]->data + image_width * image_height + (image_width>>1) * y + x;
+ if(image_format!=IMGFMT_YV12) dst+=(image_width>>1)*(image_height>>1);
  src = image[2];
  if(w==stride[2] && w==image_width/2) memcpy(dst,src,w*h);
   else
@@ -630,7 +631,9 @@
      src+=stride[2];
      dst+=image_width/2;
    }
- dst = xvimage[current_buf]->data + image_width * image_height * 5 / 4 + image_width/2 * y + x;
+
+ dst = xvimage[current_buf]->data + image_width * image_height + (image_width>>1) * y + x;
+ if(image_format==IMGFMT_YV12) dst+=(image_width>>1)*(image_height>>1);
  src = image[1];
  if(w==stride[1] && w==image_width/2) memcpy(dst,src,w*h);
   else
@@ -715,9 +718,15 @@
     if(mpi->width==image_width){
        if(mpi->flags&MP_IMGFLAG_PLANAR){
 	   mpi->planes[0]=xvimage[current_buf]->data;
-	   mpi->planes[2]=xvimage[current_buf]->data+image_width*image_height;
-//	   mpi->planes[1]=xvimage[current_buf]->data+image_width*image_height*5/4;
-	   mpi->planes[1]=mpi->planes[2]+(image_width>>1)*(image_height>>1);
+	   if(mpi->flags&MP_IMGFLAG_SWAPPED){
+	       // I420
+	       mpi->planes[1]=xvimage[current_buf]->data+image_width*image_height;
+	       mpi->planes[2]=mpi->planes[1]+(image_width>>1)*(image_height>>1);
+	   } else {
+	       // YV12
+	       mpi->planes[2]=xvimage[current_buf]->data+image_width*image_height;
+	       mpi->planes[1]=mpi->planes[2]+(image_width>>1)*(image_height>>1);
+	   }
 	   mpi->stride[0]=image_width;
 	   mpi->stride[1]=mpi->stride[2]=image_width/2;
        } else {




More information about the MPlayer-cvslog mailing list