[Mplayer-cvslog] CVS: main/libvo vo_vesa.c,1.83,1.84

Filip Kalinski CVS filon at mplayerhq.hu
Sun Jan 5 12:24:40 CET 2003


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

Modified Files:
	vo_vesa.c 
Log Message:
Check if we can open /dev/mem in preinit(), so we can exit cleanly.


Index: vo_vesa.c
===================================================================
RCS file: /cvsroot/mplayer/main/libvo/vo_vesa.c,v
retrieving revision 1.83
retrieving revision 1.84
diff -u -r1.83 -r1.84
--- vo_vesa.c	4 Jan 2003 22:41:52 -0000	1.83
+++ vo_vesa.c	5 Jan 2003 11:24:13 -0000	1.84
@@ -28,6 +28,7 @@
 #include <pwd.h>
 #include <sys/types.h>
 #include <sys/stat.h>
+#include <fcntl.h>
 
 
 #include "video_out.h"
@@ -1009,6 +1010,7 @@
 static uint32_t preinit(const char *arg)
 {
   int pre_init_err = 0;
+  int fd;
   if(verbose>1) printf("vo_vesa: preinit(%s) was called\n",arg);
   if(verbose > 2)
         printf("vo_vesa: subdevice %s is being initialized\n",arg);
@@ -1018,6 +1020,11 @@
 #ifdef CONFIG_VIDIX
   else if(vidix_name) pre_init_err = vidix_preinit(vidix_name,&video_out_vesa);
 #endif
+  // check if we can open /dev/mem (it will be opened later in config(), but if we
+  // detect now that we can't we can exit cleanly)
+  fd = open("/dev/mem", O_RDWR);
+  if (fd < 0)
+  	return -1;
   if(verbose > 2)
         printf("vo_subdevice: initialization returns: %i\n",pre_init_err);
   return pre_init_err;



More information about the MPlayer-cvslog mailing list