Mercurial > mplayer.hg
changeset 246:5673f9146c54
clear the frame on uninit
author | szabii |
---|---|
date | Thu, 29 Mar 2001 14:20:01 +0000 |
parents | cb4c682746c0 |
children | dd107cd7686d |
files | libvo/vo_fbdev.c |
diffstat | 1 files changed, 19 insertions(+), 4 deletions(-) [+] |
line wrap: on
line diff
--- a/libvo/vo_fbdev.c Thu Mar 29 13:58:54 2001 +0000 +++ b/libvo/vo_fbdev.c Thu Mar 29 14:20:01 2001 +0000 @@ -37,6 +37,8 @@ static int fb_bpp; 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 int in_width; static int in_height; @@ -119,6 +121,8 @@ } /* disable scrolling */ + fb_xres_virtual = fb_var_info.xres_virtual; + fb_yres_virtual = fb_var_info.yres_virtual; fb_var_info.xres_virtual = fb_var_info.xres; fb_var_info.yres_virtual = fb_var_info.yres; @@ -310,12 +314,10 @@ { } -static void flip_page(void) +static void put_frame(void) { int i, out_offset = 0, in_offset = 0; - vo_draw_text(in_width, in_height, draw_alpha); - check_events(); for (i = 0; i < in_height; i++) { memcpy(frame_buffer + out_offset, next_frame + in_offset, in_width * (fb_bpp / 8)); @@ -324,11 +326,24 @@ } } +static void flip_page(void) +{ + vo_draw_text(in_width, in_height, draw_alpha); + check_events(); + put_frame(); +} + static void uninit(void) { + printf("vo_fbdev: uninit\n"); + fb_var_info.xres_virtual = fb_xres_virtual; + fb_var_info.yres_virtual = fb_yres_virtual; + if (ioctl(fb_dev_fd, FBIOPUT_VSCREENINFO, &fb_var_info)) + printf("vo_fbdev: Can't set virtual screensize to original value: %s\n", strerror(errno)); + memset(next_frame, '\0', in_height * in_width * (fb_bpp / 8)); + put_frame(); if (vt_active >= 0) ioctl(vt_fd, VT_ACTIVATE, vt_active); - printf("vo_fbdev: uninit\n"); free(next_frame); munmap(frame_buffer, fb_size); }