38 static int config(
struct vf_instance *vf,
40 unsigned int flags,
unsigned int outfmt)
42 if (vf->priv->aspect < 0.001) {
43 if (vf->priv->w == 0) vf->priv->w = d_width;
44 if (vf->priv->h == 0) vf->priv->h = d_height;
45 if (vf->priv->w == -1) vf->priv->w =
width;
46 if (vf->priv->h == -1) vf->priv->h =
height;
47 if (vf->priv->w == -2) vf->priv->w = vf->priv->h * (double)d_width / d_height;
48 if (vf->priv->w == -3) vf->priv->w = vf->priv->h * (double)width / height;
49 if (vf->priv->h == -2) vf->priv->h = vf->priv->w * (double)d_height / d_width;
50 if (vf->priv->h == -3) vf->priv->h = vf->priv->w * (double)height / width;
51 if (vf->priv->method > -1) {
52 double aspect = (vf->priv->method & 2) ? ((
double)height /
width) : ((
double)d_height / d_width);
53 if ((vf->priv->h > vf->priv->w * aspect) ^ (vf->priv->method & 1)) {
54 vf->priv->h = vf->priv->w * aspect;
56 vf->priv->w = vf->priv->h / aspect;
59 if (vf->priv->round > 1) {
60 vf->priv->w += (vf->priv->round - 1 - (vf->priv->w - 1) % vf->priv->round);
61 vf->priv->h += (vf->priv->round - 1 - (vf->priv->h - 1) % vf->priv->round);
63 d_width = vf->priv->w;
64 d_height = vf->priv->h;
66 if (vf->priv->aspect * height > width) {
67 d_width = height * vf->priv->aspect + .5;
70 d_height = width / vf->priv->aspect + .5;
95 if (strchr(args,
'/')) {
97 sscanf(args,
"%d/%d", &w, &h);
99 }
else if (strchr(args,
'.')) {
117 "reset displaysize/aspect",