# HG changeset patch # User szabii # Date 986684714 0 # Node ID 344d115a285d6082aa3e031871d7e779f89012a4 # Parent 6c3a6322f81cd008454313773369a89976fa1ee5 restore old cmap diff -r 6c3a6322f81c -r 344d115a285d libvo/vo_fbdev.c --- a/libvo/vo_fbdev.c Sat Apr 07 22:03:18 2001 +0000 +++ b/libvo/vo_fbdev.c Sat Apr 07 23:05:14 2001 +0000 @@ -47,6 +47,7 @@ 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 @@ } 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 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) {