[Mplayer-cvslog] CVS: main/libvo vo_x11.c,1.56,1.57

Michael Niedermayer michael at mplayer.dev.hu
Tue Feb 5 20:54:51 CET 2002


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

Modified Files:
	vo_x11.c 
Log Message:
checking output of getSwsContext*()
101 I420/IYUV support without -zoom


Index: vo_x11.c
===================================================================
RCS file: /cvsroot/mplayer/main/libvo/vo_x11.c,v
retrieving revision 1.56
retrieving revision 1.57
diff -u -r1.56 -r1.57
--- vo_x11.c	3 Feb 2002 14:41:31 -0000	1.56
+++ vo_x11.c	5 Feb 2002 19:54:38 -0000	1.57
@@ -473,22 +473,26 @@
   int newW= vo_dwidth&(~1);  // the swscaler should be able to handle odd sizes but something else doesnt seem to like it
   int newH= vo_dheight&(~1);
     
-  if(newH==0) newH=2;
   if(sws_flags==0) newW&= (~31); // not needed but, if the user wants the FAST_BILINEAR SCALER, then its needed
-  if(newW<8) newW=8;
   
   if(image_width!=newW || image_height!=newH)
   {
     SwsContext *oldContext= swsContext;
-    image_width= newW;
-    image_height= newH;
     
-    freeMyXImage();
-    getMyXImage();
-
     swsContext= getSwsContextFromCmdLine(oldContext->srcW, oldContext->srcH, oldContext->srcFormat, 
-    					 image_width, image_height, out_format);
-    freeSwsContext(oldContext);
+    					 newW, newH, out_format);
+    if(swsContext)
+    {
+	image_width= newW;
+	image_height= newH;
+	freeMyXImage();
+	getMyXImage();
+	freeSwsContext(oldContext);
+    }    
+    else
+    {
+	swsContext= oldContext;
+    }
   }
   dstStride[0]=image_width*((bpp+7)/8);
   dstStride[1]=
@@ -500,7 +504,10 @@
   swScale(swsContext,src,stride,y,h,dst, dstStride);
 } else {
  uint8_t *dst=ImageData + ( image_width * y + x ) * ( bpp/8 );
- yuv2rgb( dst,src[0],src[1],src[2],w,h,image_width*( bpp/8 ),stride[0],stride[1] );
+ if(image_format==IMGFMT_YV12)
+   yuv2rgb( dst,src[0],src[1],src[2],w,h,image_width*( bpp/8 ),stride[0],stride[1] );
+ else /* I420 & IYUV */
+   yuv2rgb( dst,src[0],src[2],src[1],w,h,image_width*( bpp/8 ),stride[0],stride[1] );
 }
  return 0;
 }




More information about the MPlayer-cvslog mailing list