1
0
mirror of https://github.com/mpv-player/mpv synced 2024-12-22 23:02:37 +00:00

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.
This commit is contained in:
Rudolf Polzer 2012-09-24 16:34:03 +02:00
parent bcbc30e487
commit 5a3045f1a2

View File

@ -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 */