[MPlayer-cvslog] r27999 - in trunk/libvo: vo_fbdev.c vo_wii.c

diego subversion at mplayerhq.hu
Sun Nov 23 15:57:51 CET 2008


Author: diego
Date: Sun Nov 23 15:57:51 2008
New Revision: 27999

Log:
Handle fb_dev_name similar to vo_fbdev in vo_wii.


Modified:
   trunk/libvo/vo_fbdev.c
   trunk/libvo/vo_wii.c

Modified: trunk/libvo/vo_fbdev.c
==============================================================================
--- trunk/libvo/vo_fbdev.c	(original)
+++ trunk/libvo/vo_fbdev.c	Sun Nov 23 15:57:51 2008
@@ -532,7 +532,7 @@ static void fb_mode2fb_vinfo(fb_mode_t *
 ******************************/
 
 /* command line/config file options */
-char *fb_dev_name = NULL;
+static char *fb_dev_name = NULL;
 char *fb_mode_cfgfile = NULL;
 char *fb_mode_name = NULL;
 

Modified: trunk/libvo/vo_wii.c
==============================================================================
--- trunk/libvo/vo_wii.c	(original)
+++ trunk/libvo/vo_wii.c	Sun Nov 23 15:57:51 2008
@@ -54,8 +54,6 @@
 #include "sub.h"
 #include "mp_msg.h"
 
-#define WII_DEV_NAME "/dev/fb0"
-
 static const vo_info_t info = {
   "Nintendo Wii/GameCube Framebuffer Device",
   "wii",
@@ -67,6 +65,8 @@ LIBVO_EXTERN(wii)
 
 static signed int pre_init_err = -2;
 
+static char *fb_dev_name = NULL;
+
 static FILE *vt_fp = NULL;
 static int vt_doit = 1;
 static int fb_dev_fd = -1;
@@ -98,8 +98,12 @@ static int fb_preinit(int reset)
   if (fb_preinit_done)
     return fb_works;
 
-  if ((fb_dev_fd = open(WII_DEV_NAME, O_RDWR)) == -1) {
-    mp_msg(MSGT_VO, MSGL_ERR, "Can't open %s: %s\n", WII_DEV_NAME, strerror(errno));
+  if (!fb_dev_name && !(fb_dev_name = getenv("FRAMEBUFFER")))
+    fb_dev_name = strdup("/dev/fb0");
+  mp_msg(MSGT_VO, MSGL_V, "using %s\n", fb_dev_name);
+
+  if ((fb_dev_fd = open(fb_dev_name, O_RDWR)) == -1) {
+    mp_msg(MSGT_VO, MSGL_ERR, "Can't open %s: %s\n", fb_dev_name, strerror(errno));
     goto err_out;
   }
   if (ioctl(fb_dev_fd, FBIOGET_VSCREENINFO, &fb_vinfo)) {
@@ -212,7 +216,7 @@ static int config(uint32_t width, uint32
   frame_buffer = NULL;
   if ((frame_buffer = (uint8_t *) mmap(0, fb_size, PROT_READ | PROT_WRITE,
                                        MAP_SHARED, fb_dev_fd, 0)) == (uint8_t *) -1) {
-    mp_msg(MSGT_VO, MSGL_ERR, "Can't mmap %s: %s\n", WII_DEV_NAME, strerror(errno));
+    mp_msg(MSGT_VO, MSGL_ERR, "Can't mmap %s: %s\n", fb_dev_name, strerror(errno));
     return 1;
   }
 



More information about the MPlayer-cvslog mailing list