diff options
author | arpi <arpi@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2002-05-12 19:06:15 +0000 |
---|---|---|
committer | arpi <arpi@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2002-05-12 19:06:15 +0000 |
commit | 6ab0d987add91595f0d01116d9506d06620719d1 (patch) | |
tree | 66368cff64099254943ff838f26ba91fac2ada46 /libmpcodecs/vf_expand.c | |
parent | 762d6ac6aad55f59959037ffbfbfbaa5ec34439d (diff) | |
download | mpv-6ab0d987add91595f0d01116d9506d06620719d1.tar.bz2 mpv-6ab0d987add91595f0d01116d9506d06620719d1.tar.xz |
keep aspect ratio - based on Fredrik Kuivinen's idea
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@6061 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libmpcodecs/vf_expand.c')
-rw-r--r-- | libmpcodecs/vf_expand.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/libmpcodecs/vf_expand.c b/libmpcodecs/vf_expand.c index 0d4030adfb..b612ab390d 100644 --- a/libmpcodecs/vf_expand.c +++ b/libmpcodecs/vf_expand.c @@ -26,6 +26,9 @@ struct vf_priv_s { unsigned char* fb_ptr; }; +extern int opt_screen_size_x; +extern int opt_screen_size_y; + //===========================================================================// #ifdef OSD_SUPPORT @@ -143,7 +146,6 @@ static void draw_osd(struct vf_instance_s* vf_,int w,int h){ static int config(struct vf_instance_s* vf, int width, int height, int d_width, int d_height, unsigned int flags, unsigned int outfmt){ - int ret; // calculate the missing parameters: #if 0 if(vf->priv->exp_w<width) vf->priv->exp_w=width; @@ -159,8 +161,12 @@ static int config(struct vf_instance_s* vf, if(vf->priv->exp_x<0 || vf->priv->exp_x+width>vf->priv->exp_w) vf->priv->exp_x=(vf->priv->exp_w-width)/2; if(vf->priv->exp_y<0 || vf->priv->exp_y+height>vf->priv->exp_h) vf->priv->exp_y=(vf->priv->exp_h-height)/2; vf->priv->fb_ptr=NULL; - ret=vf_next_config(vf,vf->priv->exp_w,vf->priv->exp_h,d_width,d_height,flags,outfmt); - return ret; + + if(!opt_screen_size_x && !opt_screen_size_y){ + d_width=d_width*vf->priv->exp_w/width; + d_height=d_height*vf->priv->exp_h/height; + } + return vf_next_config(vf,vf->priv->exp_w,vf->priv->exp_h,d_width,d_height,flags,outfmt); } // there are 4 cases: |