From a2dfc7a766c2f00408671327838602eebcc4cddf Mon Sep 17 00:00:00 2001 From: mark Date: Wed, 23 Oct 2002 16:52:54 +0000 Subject: Added the -geometry option (supports fbdev and tdfxfb drivers) git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@7867 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libvo/vo_fbdev.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'libvo/vo_fbdev.c') diff --git a/libvo/vo_fbdev.c b/libvo/vo_fbdev.c index 9d03a4fbb8..a9f0608ad4 100644 --- a/libvo/vo_fbdev.c +++ b/libvo/vo_fbdev.c @@ -1037,12 +1037,8 @@ static uint32_t config(uint32_t width, uint32_t height, uint32_t d_width, image_width=width; image_height=height; } - if(fb_xres > image_width) - x_offset = (fb_xres - image_width) / 2; - else x_offset = 0; - if(fb_yres > image_height) - y_offset = (fb_yres - image_height) / 2; - else y_offset = 0; + geometry(&x_offset,&y_offset,fb_xres,fb_yres,image_width,image_height); + if(vidix_init(width,height,x_offset,y_offset,image_width, image_height,format,fb_bpp, fb_xres,fb_yres) != 0) @@ -1058,13 +1054,18 @@ static uint32_t config(uint32_t width, uint32_t height, uint32_t d_width, else #endif { + int x_offset,y_offset; if ((frame_buffer = (uint8_t *) mmap(0, fb_size, PROT_READ | PROT_WRITE, MAP_SHARED, fb_dev_fd, 0)) == (uint8_t *) -1) { printf(FBDEV "Can't mmap %s: %s\n", fb_dev_name, strerror(errno)); return 1; } + + geometry(&x_offset,&y_offset,fb_xres,fb_yres,out_width,out_height); + L123123875 = frame_buffer + (out_width - in_width) * fb_pixel_size / - 2 + ( (out_height - in_height) / 2 ) * fb_line_len; + 2 + ( (out_height - in_height) / 2 ) * fb_line_len + + x_offset * fb_pixel_size + y_offset * fb_line_len; if (verbose > 0) { if (verbose > 1) { -- cgit v1.2.3