diff options
author | faust3 <faust3@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2004-09-15 14:08:46 +0000 |
---|---|---|
committer | faust3 <faust3@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2004-09-15 14:08:46 +0000 |
commit | 3616785033f4b5e2e858d7ef82c31a4818d49249 (patch) | |
tree | 208efaf6319c838803d17becac66e95bb5191f8a /input | |
parent | 0e339fc397e7238ad8d31a8f2e8ae86f63c22959 (diff) | |
download | mpv-3616785033f4b5e2e858d7ef82c31a4818d49249.tar.bz2 mpv-3616785033f4b5e2e858d7ef82c31a4818d49249.tar.xz |
fix a memory corruption and make sure only getch2 handles stdin
in order to avoid delayed events caused by lost input
patch by Mikulas Patocka <mikulas at artax.karlin.mff.cuni.cz>
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@13346 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'input')
-rw-r--r-- | input/input.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/input/input.c b/input/input.c index 2ac4d9da32..89d289c714 100644 --- a/input/input.c +++ b/input/input.c @@ -661,7 +661,7 @@ mp_input_default_key_func(int fd) { unsigned int l; l = 0; while(l < sizeof(int)) { - r = read(fd,(&code)+l,sizeof(int)-l); + r = read(fd,((char *)&code)+l,sizeof(int)-l); if(r <= 0) break; l +=r; @@ -907,7 +907,7 @@ if(n>0){ } #ifndef HAVE_NO_POSIX_SELECT // No input from this fd - if(! (key_fds[i].flags & MP_FD_NO_SELECT) && ! FD_ISSET(key_fds[i].fd,&fds)) + if(! (key_fds[i].flags & MP_FD_NO_SELECT) && ! FD_ISSET(key_fds[i].fd,&fds) && key_fds[i].fd != 0) continue; #endif if(key_fds[i].fd == 0) { // stdin is handled by getch2 |