From 921a9c9f2d2d1d13c54b1e454ed1cf299814a1cd Mon Sep 17 00:00:00 2001 From: szabii Date: Mon, 16 Apr 2001 22:27:32 +0000 Subject: cmap bug fixed (I think) git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@482 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libvo/vo_fbdev.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'libvo') diff --git a/libvo/vo_fbdev.c b/libvo/vo_fbdev.c index 16024002b0..30d7a44b06 100644 --- a/libvo/vo_fbdev.c +++ b/libvo/vo_fbdev.c @@ -541,7 +541,8 @@ static uint8_t *frame_buffer; static struct fb_fix_screeninfo fb_finfo; static struct fb_var_screeninfo fb_orig_vinfo; static struct fb_var_screeninfo fb_vinfo; -static struct fb_cmap *fb_oldcmap = NULL; +static struct fb_cmap fb_oldcmap; +static int fb_cmap_changed = 0; static int fb_pixel_size; // 32: 4 24: 3 16: 2 15: 2 static int fb_real_bpp; // 32: 24 24: 24 16: 16 15: 15 static int fb_bpp; // 32: 32 24: 24 16: 16 15: 15 @@ -855,7 +856,7 @@ static uint32_t init(uint32_t width, uint32_t height, uint32_t d_width, case FB_VISUAL_DIRECTCOLOR: if (verbose > 0) printf(FBDEV "creating cmap for directcolor\n"); - if (ioctl(fb_dev_fd, FBIOGETCMAP, fb_oldcmap)) { + if (ioctl(fb_dev_fd, FBIOGETCMAP, &fb_oldcmap)) { printf(FBDEV "can't get cmap: %s\n", strerror(errno)); return 1; @@ -867,6 +868,7 @@ static uint32_t init(uint32_t width, uint32_t height, uint32_t d_width, strerror(errno)); return 1; } + fb_cmap_changed = 1; free(cmap->red); free(cmap->green); free(cmap->blue); @@ -1105,10 +1107,10 @@ static void uninit(void) { if (verbose > 0) printf(FBDEV "uninit\n"); - if (fb_oldcmap) { - if (ioctl(fb_dev_fd, FBIOPUTCMAP, fb_oldcmap)) + if (fb_cmap_changed) { + if (ioctl(fb_dev_fd, FBIOPUTCMAP, &fb_oldcmap)) printf(FBDEV "Can't restore original cmap\n"); - fb_oldcmap = NULL; + fb_cmap_changed = 0; } if (ioctl(fb_dev_fd, FBIOPUT_VSCREENINFO, &fb_orig_vinfo)) printf(FBDEV "Can't set virtual screensize to original value: %s\n", strerror(errno)); -- cgit v1.2.3