[MPlayer-dev-eng] kbd echo fix: why -vo svga uninit terminal order is bad

Dimitar Zhekov jimmy at is-vn.bg
Wed May 8 14:55:08 CEST 2002


>i've changed the uninit order instead of applying his patch
>see at uninit_player() in mplayer.c

I know. Yes, vo_svga.c:uninit() calls vga_setmode(TEXT), which
restores the terminal state, but...

>but still wonder why uninit order is bad

...it is restored once again after exit() or main(). From svgalib:

vga.c: initialize(): ... if (my_pid == 0) my_pid = getpid();
atexit(__vga_atexit); ...
vga.c: __vga_atexit(): ... if (getpid() == my_pid) restoretextmode(); ...
vga.c: restoretextmode(): ... __svgalib_set_texttermio(); ...

so you just can't place getch2_disable() at the right place, except by
calling atexit(getch2_disable) at some point.

E-gards: Jimmy





More information about the MPlayer-dev-eng mailing list