[MPlayer-cvslog] CVS: main/libmpdemux dvbin.c,1.13,1.14

Nico Sabbi CVS syncmail at mplayerhq.hu
Mon Apr 18 21:49:43 CEST 2005


CVS change done by Nico Sabbi CVS

Update of /cvsroot/mplayer/main/libmpdemux
In directory mail:/var2/tmp/cvs-serv17253

Modified Files:
	dvbin.c 
Log Message:
check the result of poll() before read()ing; 100l

Index: dvbin.c
===================================================================
RCS file: /cvsroot/mplayer/main/libmpdemux/dvbin.c,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -r1.13 -r1.14
--- dvbin.c	16 Apr 2005 12:51:09 -0000	1.13
+++ dvbin.c	18 Apr 2005 19:49:40 -0000	1.14
@@ -404,14 +404,8 @@
 		pfds[0].fd = fd;
 		pfds[0].events = POLLIN | POLLPRI;
 
-		poll(pfds, 1, 500);
 		rk = size - pos;
-		if((rk = read(fd, &buffer[pos], rk)) > 0)
-		{
-			pos += rk;
-			mp_msg(MSGT_DEMUX, MSGL_DBG3, "ret (%d) bytes\n", pos);
-		}
-		else
+		if(poll(pfds, 1, 500) <= 0)
 		{
 			errno = 0;
 			mp_msg(MSGT_DEMUX, MSGL_ERR, "dvb_streaming_read, attempt N. %d failed with errno %d when reading %d bytes\n", tries, errno, size-pos);
@@ -419,8 +413,14 @@
 				continue;
 			else
 				break;
-			}
 		}
+		if((rk = read(fd, &buffer[pos], rk)) > 0)
+		{
+			pos += rk;
+			mp_msg(MSGT_DEMUX, MSGL_DBG3, "ret (%d) bytes\n", pos);
+		}
+	}
+		
 
 	if(! pos)
 		mp_msg(MSGT_DEMUX, MSGL_ERR, "dvb_streaming_read, return %d bytes\n", pos);




More information about the MPlayer-cvslog mailing list