changeset 11015:5331f38c8db7

correct handling of select ret=0, patch by Jonas Jensen <jbj@knef.dk>
author alex
date Sun, 05 Oct 2003 14:17:29 +0000
parents b02ee343b0e1
children 8bad8ffae07b
files libmpcodecs/vf_bmovl.c
diffstat 1 files changed, 6 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/libmpcodecs/vf_bmovl.c	Sun Oct 05 11:40:55 2003 +0000
+++ b/libmpcodecs/vf_bmovl.c	Sun Oct 05 14:17:29 2003 +0000
@@ -214,11 +214,13 @@
 
     if(vf->priv->stream_fd >= 0) {
 		struct timeval tv;
+		int ready;
 
 		FD_SET( vf->priv->stream_fd, &vf->priv->stream_fdset );
 		tv.tv_sec=0; tv.tv_usec=0;
 
-		if( select( vf->priv->stream_fd+1, &vf->priv->stream_fdset, NULL, NULL, &tv ) > 0) {
+		ready = select( vf->priv->stream_fd+1, &vf->priv->stream_fdset, NULL, NULL, &tv );
+		if(ready > 0) {
 			// We've got new data from the FIFO
 
 			char cmd[20], args[100];
@@ -362,7 +364,9 @@
 				} // for buf_x
 			} // for buf_y
 			free (buffer);
-		} else if(errno) mp_msg(MSGT_VFILTER, MSGL_WARN, "\nvf_bmovl: Error %d in fifo: %s\n\n", errno, strerror(errno));
+		} else if(ready < 0) {
+			mp_msg(MSGT_VFILTER, MSGL_WARN, "\nvf_bmovl: Error %d in fifo: %s\n\n", errno, strerror(errno));
+		}
     }
 
 	if(vf->priv->hidden) return vf_next_put_image(vf, dmpi);