summaryrefslogtreecommitdiffstats
path: root/libvo/vo_fbdev.c
diff options
context:
space:
mode:
authormark <mark@b3059339-0415-0410-9bf9-f77b7e298cf2>2002-10-23 16:52:54 +0000
committermark <mark@b3059339-0415-0410-9bf9-f77b7e298cf2>2002-10-23 16:52:54 +0000
commita2dfc7a766c2f00408671327838602eebcc4cddf (patch)
tree1b668f5ecfebc6ad7688d652594f4e91179183d2 /libvo/vo_fbdev.c
parentddaa6dd19d52961065344b66a474dc4629d04cbd (diff)
downloadmpv-a2dfc7a766c2f00408671327838602eebcc4cddf.tar.bz2
mpv-a2dfc7a766c2f00408671327838602eebcc4cddf.tar.xz
Added the -geometry option (supports fbdev and tdfxfb drivers)
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@7867 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libvo/vo_fbdev.c')
-rw-r--r--libvo/vo_fbdev.c15
1 files changed, 8 insertions, 7 deletions
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) {