[Mplayer-cvslog] CVS: main/libvo vo_mga.c,1.23,1.24

Arpi of Ize arpi at mplayer.dev.hu
Sat Feb 9 02:10:25 CET 2002


Update of /cvsroot/mplayer/main/libvo
In directory mplayer:/var/tmp.root/cvs-serv30520

Modified Files:
	vo_mga.c 
Log Message:
screensize from fbdev ioctl - patch by Jason Lunz <j at falooley.org>

Index: vo_mga.c
===================================================================
RCS file: /cvsroot/mplayer/main/libvo/vo_mga.c,v
retrieving revision 1.23
retrieving revision 1.24
diff -u -r1.23 -r1.24
--- vo_mga.c	9 Feb 2002 00:47:26 -0000	1.23
+++ vo_mga.c	9 Feb 2002 01:10:22 -0000	1.24
@@ -38,6 +38,7 @@
 #include <unistd.h>
 #include <fcntl.h>
 #include <sys/mman.h>
+#include <linux/fb.h>
 
 #include "drivers/mga_vid.h"
 #include "sub.h"
@@ -54,10 +55,29 @@
 
 #include "mga_common.c"
 
+#define FBDEV	"/dev/fb0"
+
 static uint32_t
 config(uint32_t width, uint32_t height, uint32_t d_width, uint32_t d_height, uint32_t fullscreen, char *title, uint32_t format,const vo_tune_info_t *info)
 {
 char *devname=vo_subdevice?vo_subdevice:"/dev/mga_vid";
+
+	if(!vo_screenwidth || !vo_screenheight) {
+		int fd;
+		struct fb_var_screeninfo fbinfo;
+
+		if(-1 != (fd = open(FBDEV, O_RDONLY))) {
+			if(0 == ioctl(fd, FBIOGET_VSCREENINFO, &fbinfo)) {
+				if(!vo_screenwidth)   vo_screenwidth = fbinfo.xres;
+				if(!vo_screenheight) vo_screenheight = fbinfo.yres;
+			} else {
+				perror("FBIOGET_VSCREENINFO");
+			}
+			close(fd);
+		} else {
+			perror(FBDEV);
+		}
+	}
 
 	if(vo_screenwidth && vo_screenheight){
 		aspect_save_orig(width,height);




More information about the MPlayer-cvslog mailing list