Mercurial > mplayer.hg
annotate fifo.c @ 9771:25614fe4ed1a
objfix has to be run on MINGW32, too
author | faust3 |
---|---|
date | Mon, 31 Mar 2003 17:08:16 +0000 |
parents | 44198b2f42db |
children | 0397b461f0fb |
rev | line source |
---|---|
113 | 1 |
2 // keyboard: | |
3 static int keyb_fifo_put=-1; | |
4 static int keyb_fifo_get=-1; | |
5 | |
6 static void make_pipe(int* pr,int* pw){ | |
7 int temp[2]; | |
8 if(pipe(temp)!=0) printf("Cannot make PIPE!\n"); | |
9 *pr=temp[0]; | |
10 *pw=temp[1]; | |
11 } | |
12 | |
13 void mplayer_put_key(int code){ | |
14 fd_set rfds; | |
15 struct timeval tv; | |
16 | |
17 /* Watch stdin (fd 0) to see when it has input. */ | |
18 FD_ZERO(&rfds); | |
19 FD_SET(keyb_fifo_put, &rfds); | |
20 tv.tv_sec = 0; | |
21 tv.tv_usec = 0; | |
22 | |
23 //retval = select(keyb_fifo_put+1, &rfds, NULL, NULL, &tv); | |
3014
16576e05b93a
Profiling fix by Artur Skawina <skawina@geocities.com>
atmos4
parents:
113
diff
changeset
|
24 if(select(keyb_fifo_put+1, NULL, &rfds, NULL, &tv)>0){ |
113 | 25 write(keyb_fifo_put,&code,4); |
26 // printf("*** key event %d sent ***\n",code); | |
27 } else { | |
28 // printf("*** key event dropped (FIFO is full) ***\n"); | |
29 } | |
30 } |