summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRudolf Polzer <divverent@xonotic.org>2012-09-24 16:34:03 +0200
committerRudolf Polzer <divverent@xonotic.org>2012-09-24 16:41:12 +0200
commit5a3045f1a27e350e919723921d365321e4ef8dfc (patch)
treef8ab9edf4d54e6f9378d5b7128f9fe3d240c9c6d
parentbcbc30e48725ef051d582b56285c064d1ad3f299 (diff)
downloadmpv-5a3045f1a27e350e919723921d365321e4ef8dfc.tar.bz2
mpv-5a3045f1a27e350e919723921d365321e4ef8dfc.tar.xz
vf_scale: do the upscale detection AFTER calculating dimensions
Otherwise it heavily violates the manpage's description, and describing what it did before in the documentation is something too complicated to describe in the English language.
-rw-r--r--libmpcodecs/vf_scale.c15
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 */