diff libmpcodecs/vf_scale.c @ 5712:6c6e55db908f

swscaler yv12 vs i420 workaround
author arpi
date Fri, 19 Apr 2002 23:29:41 +0000
parents 1972c3475d93
children 28f800545e63
line wrap: on
line diff
--- a/libmpcodecs/vf_scale.c	Fri Apr 19 23:24:13 2002 +0000
+++ b/libmpcodecs/vf_scale.c	Fri Apr 19 23:29:41 2002 +0000
@@ -93,8 +93,10 @@
     if(vf->priv->ctx) freeSwsContext(vf->priv->ctx);
     
     // new swscaler:
-    vf->priv->ctx=getSwsContextFromCmdLine(width,height,outfmt,
-		  vf->priv->w,vf->priv->h,best);
+    vf->priv->ctx=getSwsContextFromCmdLine(width,height,
+	    (outfmt==IMGFMT_I420 || outfmt==IMGFMT_IYUV)?IMGFMT_YV12:outfmt,
+		  vf->priv->w,vf->priv->h,
+	    (best==IMGFMT_I420 || best==IMGFMT_IYUV)?IMGFMT_YV12:best);
     if(!vf->priv->ctx){
 	// error...
 	printf("Couldn't init SwScaler for this setup\n");