summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--libmpcodecs/vf_expand.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/libmpcodecs/vf_expand.c b/libmpcodecs/vf_expand.c
index dd2ffa47f0..4ca020de57 100644
--- a/libmpcodecs/vf_expand.c
+++ b/libmpcodecs/vf_expand.c
@@ -183,10 +183,11 @@ static int config(struct vf_instance_s* vf,
else if( vf->priv->exp_h<height ) vf->priv->exp_h=height;
#endif
if (vf->priv->aspect) {
+ vf->priv->aspect *= ((double)width/height) / ((double)d_width/d_height);
if (vf->priv->exp_h < vf->priv->exp_w / vf->priv->aspect) {
- vf->priv->exp_h = vf->priv->exp_w / vf->priv->aspect;
+ vf->priv->exp_h = vf->priv->exp_w / vf->priv->aspect + 0.5;
} else {
- vf->priv->exp_w = vf->priv->exp_h * vf->priv->aspect;
+ vf->priv->exp_w = vf->priv->exp_h * vf->priv->aspect + 0.5;
}
}
if (vf->priv->round > 1) { // round up.