1
0
mirror of https://github.com/mpv-player/mpv synced 2025-01-02 21:12:23 +00:00

Profiling fix by Artur Skawina <skawina@geocities.com>

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@3015 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
atmos4 2001-11-20 00:23:49 +00:00
parent 3c25d58ba3
commit e7df17dcda
2 changed files with 3 additions and 3 deletions

4
fifo.c
View File

@ -51,7 +51,7 @@ void mplayer_put_key(int code){
tv.tv_usec = 0; tv.tv_usec = 0;
//retval = select(keyb_fifo_put+1, &rfds, NULL, NULL, &tv); //retval = select(keyb_fifo_put+1, &rfds, NULL, NULL, &tv);
if(select(keyb_fifo_put+1, NULL, &rfds, NULL, &tv)){ if(select(keyb_fifo_put+1, NULL, &rfds, NULL, &tv)>0){
write(keyb_fifo_put,&code,4); write(keyb_fifo_put,&code,4);
// printf("*** key event %d sent ***\n",code); // printf("*** key event %d sent ***\n",code);
} else { } else {
@ -71,7 +71,7 @@ int mplayer_get_key(){
tv.tv_usec = 0; tv.tv_usec = 0;
//retval = select(keyb_fifo_put+1, &rfds, NULL, NULL, &tv); //retval = select(keyb_fifo_put+1, &rfds, NULL, NULL, &tv);
if(select(keyb_fifo_put+1, &rfds, NULL, NULL, &tv)){ if(select(keyb_fifo_put+1, &rfds, NULL, NULL, &tv)>0){
read(keyb_fifo_get,&code,4); read(keyb_fifo_get,&code,4);
// printf("*** key event %d read ***\n",code); // printf("*** key event %d read ***\n",code);
} }

View File

@ -130,7 +130,7 @@ int getch2(int time){
/* Wait up to 'time' microseconds. */ /* Wait up to 'time' microseconds. */
tv.tv_sec=time/1000; tv.tv_usec = (time%1000)*1000; tv.tv_sec=time/1000; tv.tv_usec = (time%1000)*1000;
retval=select(1, &rfds, NULL, NULL, &tv); retval=select(1, &rfds, NULL, NULL, &tv);
if(!retval) return -1; if(retval<=0) return -1;
/* Data is available now. */ /* Data is available now. */
retval=read(0,&getch2_buf[getch2_len],BUF_LEN-getch2_len); retval=read(0,&getch2_buf[getch2_len],BUF_LEN-getch2_len);
if(retval<1) return -1; if(retval<1) return -1;