changeset 17646:168d8eb397f1

no upscale flag so automatic downscaling is possible in mencoder
author michael
date Sat, 18 Feb 2006 21:12:56 +0000
parents 8db0816a9226
children 1b74cb09e9c1
files libmpcodecs/vf_scale.c
diffstat 1 files changed, 9 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/libmpcodecs/vf_scale.c	Sat Feb 18 20:04:42 2006 +0000
+++ b/libmpcodecs/vf_scale.c	Sat Feb 18 21:12:56 2006 +0000
@@ -27,6 +27,7 @@
     struct SwsContext *ctx2; //for interlaced slices only
     unsigned char* palette;
     int interlaced;
+    int noup;
     int query_format_cache[64];
 } vf_priv_dflt = {
   -1,-1,
@@ -144,6 +145,13 @@
 	}
     }
 
+    if(vf->priv->noup){
+        if(vf->priv->w > width)
+            vf->priv->w= width;
+        if(vf->priv->h > height)
+            vf->priv->h= height;
+    }
+
     if (vf->priv->w <= -8) {
       vf->priv->w += 8;
       round_w = 1;
@@ -603,6 +611,7 @@
   // Note that here the 2 field is NULL (ie 0)
   // As we want this option to act on the option struct itself
   {"presize", 0, CONF_TYPE_OBJ_PRESETS, 0, 0, 0, &size_preset},
+  {"noup", ST_OFF(noup), CONF_TYPE_INT, M_OPT_RANGE, 0, 1, NULL},
   { NULL, NULL, 0, 0, 0, 0,  NULL }
 };