Handle fb_dev_name similar to vo_fbdev in vo_wii.

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@27999 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
diego 2008-11-23 14:57:51 +00:00
parent 9aa2edf9d1
commit 5b239d47bd
2 changed files with 10 additions and 6 deletions

View File

@ -532,7 +532,7 @@ static void fb_mode2fb_vinfo(fb_mode_t *m, struct fb_var_screeninfo *v)
******************************/
/* 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;

View File

@ -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_t height, uint32_t d_width,
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;
}