]> git.sesse.net Git - vlc/commitdiff
* modules/access/*: don't forget to reinitialize the timeout when looping around...
authorGildas Bazin <gbazin@videolan.org>
Mon, 24 Mar 2003 19:12:16 +0000 (19:12 +0000)
committerGildas Bazin <gbazin@videolan.org>
Mon, 24 Mar 2003 19:12:16 +0000 (19:12 +0000)
modules/access/ftp.c
modules/access/http.c
modules/access/mms/mms.c
modules/access/udp.c

index 8d77c52b29b8c0b6e56ca1f5ab3fb1d56caa0845..937243c9ee17af35770fd55f43c4f3b3dbf54ff8 100644 (file)
@@ -2,7 +2,7 @@
  * ftp.c:
  *****************************************************************************
  * Copyright (C) 2001, 2002 VideoLAN
- * $Id: ftp.c,v 1.10 2003/03/24 17:15:29 gbazin Exp $
+ * $Id: ftp.c,v 1.11 2003/03/24 19:12:16 gbazin Exp $
  *
  * Authors: Laurent Aimar <fenrir@via.ecp.fr>
  *
@@ -824,14 +824,17 @@ static ssize_t NetRead( input_thread_t *p_input,
     FD_SET( p_socket->i_handle, &fds );
 
     /* We'll wait 1 second if nothing happens */
-    timeout.tv_sec  = 0;
-    timeout.tv_usec = 1000000;
+    timeout.tv_sec  = 1;
+    timeout.tv_usec = 0;
 
     /* Find if some data is available */
     while( (i_ret = select( p_socket->i_handle + 1, &fds,
                             NULL, NULL, &timeout )) == 0
            || (i_ret < 0 && errno == EINTR) )
     {
+        timeout.tv_sec  = 1;
+        timeout.tv_usec = 0;
+
         if( p_input->b_die || p_input->b_error )
         {
             return 0;
index 1494a54c8fe8bf63cf90bcbea6abd9b0edbf7f76..474f2f5b97511937f6cf97eb866459bdccc06643 100644 (file)
@@ -2,7 +2,7 @@
  * http.c: HTTP access plug-in
  *****************************************************************************
  * Copyright (C) 2001, 2002 VideoLAN
- * $Id: http.c,v 1.28 2003/03/24 17:15:29 gbazin Exp $
+ * $Id: http.c,v 1.29 2003/03/24 19:12:16 gbazin Exp $
  *
  * Authors: Christophe Massiot <massiot@via.ecp.fr>
  *
@@ -718,6 +718,9 @@ static ssize_t Read( input_thread_t * p_input, byte_t * p_buffer, size_t i_len )
 #endif
            )
     {
+        timeout.tv_sec = 0;
+        timeout.tv_usec = 500000;
+
         if( p_input->b_die || p_input->b_error )
         {
             return 0;
index bfaeb16a580e7ad74b51760c2ae2cf3707ceef32..6f2b35909049295eb0de784a20df88e69ed1c84a 100644 (file)
@@ -2,7 +2,7 @@
  * mms.c: MMS access plug-in
  *****************************************************************************
  * Copyright (C) 2001, 2002 VideoLAN
- * $Id: mms.c,v 1.28 2003/03/24 17:15:29 gbazin Exp $
+ * $Id: mms.c,v 1.29 2003/03/24 19:12:16 gbazin Exp $
  *
  * Authors: Laurent Aimar <fenrir@via.ecp.fr>
  *
@@ -1473,6 +1473,9 @@ static int  NetFillBuffer( input_thread_t *p_input )
                             NULL, NULL, &timeout )) == 0
            || (i_ret < 0 && errno == EINTR) )
     {
+        timeout.tv_sec = 0;
+        timeout.tv_usec = 500000;
+
         if( p_input->b_die || p_input->b_error )
         {
             return 0;
index 6957eed6eeb9b2a0b4a9d628c95ab0844ba2a7e2..ac0e20606f24964235eca85541c4420c57775e09 100644 (file)
@@ -2,7 +2,7 @@
  * udp.c: raw UDP & RTP access plug-in
  *****************************************************************************
  * Copyright (C) 2001, 2002 VideoLAN
- * $Id: udp.c,v 1.16 2003/03/24 17:15:29 gbazin Exp $
+ * $Id: udp.c,v 1.17 2003/03/24 19:12:16 gbazin Exp $
  *
  * Authors: Christophe Massiot <massiot@via.ecp.fr>
  *          Tristan Leteurtre <tooney@via.ecp.fr>
@@ -339,6 +339,9 @@ static ssize_t Read( input_thread_t * p_input, byte_t * p_buffer, size_t i_len )
                             NULL, NULL, &timeout )) == 0
            || (i_ret < 0 && errno == EINTR) )
     {
+        timeout.tv_sec = 0;
+        timeout.tv_usec = 500000;
+
         if( p_input->b_die || p_input->b_error )
         {
             return 0;