[Mplayer-cvslog] CVS: main/input input.c,1.68,1.69

Arpi of Ize arpi at mplayerhq.hu
Sat Mar 29 22:52:29 CET 2003


Update of /cvsroot/mplayer/main/input
In directory mail:/var/tmp.root/cvs-serv31485

Modified Files:
	input.c 
Log Message:
- 10l fix: it exited with return MP_INPUT_NOTHING; if all fd's have
  MP_FD_NO_SELECT set!
- moved time_val stuff into if(n>0), also changed misleading while(n>0) to
  while(1) (as the loop never touch n)


Index: input.c
===================================================================
RCS file: /cvsroot/mplayer/main/input/input.c,v
retrieving revision 1.68
retrieving revision 1.69
diff -u -r1.68 -r1.69
--- input.c	9 Feb 2003 20:18:18 -0000	1.68
+++ input.c	29 Mar 2003 21:52:08 -0000	1.69
@@ -782,6 +782,7 @@
 
   FD_ZERO(&fds);
   // Remove fd marked as dead and build the fd_set
+  // n == number of fd's to be select() checked
   for(i = 0; (unsigned int)i < num_key_fd; i++) {
     if( (key_fds[i].flags & MP_FD_DEAD) ) {
       mp_input_rm_key_fd(key_fds[i].fd);
@@ -795,9 +796,12 @@
     n++;
   }
 
-  if(n == 0 || num_key_fd == 0)
+  if(num_key_fd == 0)
     return MP_INPUT_NOTHING;
 
+// if we have fd's without MP_FD_NO_SELECT flag, call select():
+if(n>0){
+
   if(time >= 0 ) {
     tv.tv_sec=time/1000; 
     tv.tv_usec = (time%1000)*1000;
@@ -805,7 +809,7 @@
   } else
     time_val = NULL;
   
-  while(n > 0) {
+  while(1) {
     if(select(max_fd+1,&fds,NULL,NULL,time_val) < 0) {
       if(errno == EINTR)
 	continue;
@@ -813,7 +817,9 @@
     }
     break;
   }
-    
+
+}
+
   for(i = last_loop + 1 ; i != last_loop ; i++) {
     int code = -1;
     // This is to check all fd in turn



More information about the MPlayer-cvslog mailing list