diff -Naur MPlayer-0.90rc3/libvo/vo_vesa.c MPlayer-0.90rc3-fixvesa/libvo/vo_vesa.c --- MPlayer-0.90rc3/libvo/vo_vesa.c 2003-01-05 11:30:39.000000000 +0000 +++ MPlayer-0.90rc3-fixvesa/libvo/vo_vesa.c 2003-01-28 23:13:57.000000000 +0000 @@ -30,6 +30,7 @@ #include #include +#include #include "video_out.h" #include "video_out_internal.h" @@ -37,6 +38,7 @@ #include "fastmemcpy.h" #include "sub.h" #include "linux/vbelib.h" +#include "linux/vt.h" #include "bswap.h" #include "aspect.h" #include "vesa_lvo.h" @@ -995,6 +997,30 @@ // not inited if (!init_state) return; vesa_term(); + + /* Apparently the only way to unblanking the screen after a "vesa" playback + is to switch console, so this patch makes use of the ioctl system call + to switch back and forth from a second console. Of course this patch won't + work if the system has only one active console */ + int fb_tty_fd=-1; + int other_tty_index=-1; + struct vt_stat vesa_stat; + char *tty = "/dev/tty"; + if ((fb_tty_fd = open(tty, O_RDWR)) < 0) { + printf("notice: Can't open %s: %s\n", tty, strerror(errno)); + } + if (ioctl(fb_tty_fd, VT_GETSTATE, &vesa_stat)) { + printf("Can't get VSCREENINFO: %s\n", strerror(errno)); + } + other_tty_index = (vesa_stat.v_active == 2) ? 1 : 2; + if (ioctl(fb_tty_fd, VT_ACTIVATE, other_tty_index)) { + printf("Can't get VSCREENINFO: %s\n", strerror(errno)); + } + if (ioctl(fb_tty_fd, VT_ACTIVATE, vesa_stat.v_active)) { + printf("Can't get VSCREENINFO: %s\n", strerror(errno)); + } + close(fb_tty_fd); + if(verbose > 2) printf("vo_vesa: uninit was called\n"); }