diff options
-rw-r--r-- | libmpcodecs/vf_scale.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/libmpcodecs/vf_scale.c b/libmpcodecs/vf_scale.c index 19bfeec4d2..71428685ac 100644 --- a/libmpcodecs/vf_scale.c +++ b/libmpcodecs/vf_scale.c @@ -238,13 +238,6 @@ static int config(struct vf_instance *vf, } } - if(vf->priv->noup){ - if((vf->priv->w > width) + (vf->priv->h > height) >= vf->priv->noup){ - vf->priv->w= width; - vf->priv->h= height; - } - } - if (vf->priv->w <= -8) { vf->priv->w += 8; round_w = 1; @@ -288,6 +281,14 @@ static int config(struct vf_instance *vf, if (round_h) vf->priv->h = ((vf->priv->h + 8) / 16) * 16; + // check for upscaling, now that all parameters had been applied + if(vf->priv->noup){ + if((vf->priv->w > width) + (vf->priv->h > height) >= vf->priv->noup){ + vf->priv->w= width; + vf->priv->h= height; + } + } + // calculate the missing parameters: switch(best) { case IMGFMT_YV12: /* YV12 needs w & h rounded to 2 */ |