summaryrefslogtreecommitdiffstats
path: root/libvo/vo_fbdev.c
diff options
context:
space:
mode:
authorszabii <szabii@b3059339-0415-0410-9bf9-f77b7e298cf2>2001-04-07 23:05:14 +0000
committerszabii <szabii@b3059339-0415-0410-9bf9-f77b7e298cf2>2001-04-07 23:05:14 +0000
commitedcfc16030a2a2e13aa5f35889177598a1ed605e (patch)
tree30726315b40234f85b5182cd75b355e0816a6f20 /libvo/vo_fbdev.c
parent9b842745b93e88567e4f3b9317c2bdaf6e7ea08b (diff)
downloadmpv-edcfc16030a2a2e13aa5f35889177598a1ed605e.tar.bz2
mpv-edcfc16030a2a2e13aa5f35889177598a1ed605e.tar.xz
restore old cmap
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@307 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libvo/vo_fbdev.c')
-rw-r--r--libvo/vo_fbdev.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/libvo/vo_fbdev.c b/libvo/vo_fbdev.c
index 3d10705232..85e3a44d59 100644
--- a/libvo/vo_fbdev.c
+++ b/libvo/vo_fbdev.c
@@ -47,6 +47,7 @@ struct fb_fix_screeninfo fb_fix_info;
struct fb_var_screeninfo fb_var_info;
static uint32_t fb_xres_virtual;
static uint32_t fb_yres_virtual;
+static struct fb_cmap *oldcmap = NULL;
static int in_width;
static int in_height;
@@ -245,6 +246,11 @@ static int fb_init(void)
}
if (fb_fix_info.visual == FB_VISUAL_DIRECTCOLOR) {
printf("fb_init: creating cmap for directcolor\n");
+ if (ioctl(fb_dev_fd, FBIOGETCMAP, oldcmap)) {
+ printf("fb_init: can't get cmap: %s\n",
+ strerror(errno));
+ goto err_out_fd;
+ }
if (!(cmap = make_directcolor_cmap(&fb_var_info)))
goto err_out_fd;
if (ioctl(fb_dev_fd, FBIOPUTCMAP, cmap)) {
@@ -454,6 +460,11 @@ static void flip_page(void)
static void uninit(void)
{
printf("vo_fbdev: uninit\n");
+ if (oldcmap) {
+ if (ioctl(fb_dev_fd, FBIOPUTCMAP, oldcmap))
+ printf("vo_fbdev: Can't restore original cmap\n");
+ oldcmap = NULL;
+ }
fb_var_info.xres_virtual = fb_xres_virtual;
fb_var_info.yres_virtual = fb_yres_virtual;
if (fb_dev_fd != -1) {