--- orig/vf_expand.c Sun May 12 21:06:15 2002 +++ vf_expand.c Wed May 29 12:21:53 2002 @@ -21,6 +21,7 @@ struct vf_priv_s { int exp_w,exp_h; int exp_x,exp_y; + double aspect; mp_image_t *dmpi; int osd; unsigned char* fb_ptr; @@ -151,6 +152,11 @@ if(vf->priv->exp_wpriv->exp_w=width; if(vf->priv->exp_hpriv->exp_h=height; #else + if (vf->priv->exp_w == -1 && vf->priv->exp_h == -1 && vf->priv->aspect > 0) { + int h = width/vf->priv->aspect; + if (h > height) vf->priv->exp_h = h; + } + if ( vf->priv->exp_w == -1 ) vf->priv->exp_w=width; else if (vf->priv->exp_w < -1 ) vf->priv->exp_w=width - vf->priv->exp_w; else if ( vf->priv->exp_wpriv->exp_w=width; @@ -274,18 +280,21 @@ vf->priv->exp_y= vf->priv->exp_w= vf->priv->exp_h=-1; - if(args) sscanf(args, "%d:%d:%d:%d:%d", + vf->priv->aspect=-1; + if(args) sscanf(args, "%d:%d:%d:%d:%d:%lf", &vf->priv->exp_w, &vf->priv->exp_h, &vf->priv->exp_x, &vf->priv->exp_y, - &vf->priv->osd); - printf("Expand: %d x %d, %d ; %d (-1=autodetect) osd: %d\n", + &vf->priv->osd, + &vf->priv->aspect); + printf("Expand: %d x %d, %d ; %d (-1=autodetect) osd: %d, aspect: %.2lf\n", vf->priv->exp_w, vf->priv->exp_h, vf->priv->exp_x, vf->priv->exp_y, - vf->priv->osd); + vf->priv->osd, + vf->priv->aspect); return 1; }