mirror of
https://github.com/mpv-player/mpv
synced 2024-10-30 04:46:41 +01:00
generate meaningful d_width & d_height when scaling, rather than useless nonsense.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@10003 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
parent
38fba566e5
commit
70d3248840
@ -209,8 +209,17 @@ static int config(struct vf_instance_s* vf,
|
||||
}
|
||||
|
||||
if(!opt_screen_size_x && !opt_screen_size_y){
|
||||
d_width=d_width*vf->priv->w/width;
|
||||
d_height=d_height*vf->priv->h/height;
|
||||
// Compute new d_width and d_height, preserving aspect
|
||||
// while ensuring that both are >= output size in pixels.
|
||||
if (vf->priv->h * d_width > vf->priv->w * d_height) {
|
||||
d_width = vf->priv->h * d_width / d_height;
|
||||
d_height = vf->priv->h;
|
||||
} else {
|
||||
d_height = vf->priv->w * d_height / d_width;
|
||||
d_width = vf->priv->w;
|
||||
}
|
||||
//d_width=d_width*vf->priv->w/width;
|
||||
//d_height=d_height*vf->priv->h/height;
|
||||
}
|
||||
return vf_next_config(vf,vf->priv->w,vf->priv->h,d_width,d_height,flags,best);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user