[vlc-commits] PVR: don't choke on EINTR and fix/remove polling timer

Rémi Denis-Courmont git at videolan.org
Sun Jan 23 17:02:34 CET 2011


vlc/vlc-1.1 | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Sun Jan 23 17:51:04 2011 +0200| [bd8e2d11e5bc20abb3834810ee6edbcba2f8d816] | committer: Rémi Denis-Courmont

PVR: don't choke on EINTR and fix/remove polling timer

(cherry picked from commit e1ad2bf94fa81023c96db1f99e52d50efff5211c)

Conflicts:

	modules/access/pvr.c

> http://git.videolan.org/gitweb.cgi/vlc/vlc-1.1.git/?a=commit;h=bd8e2d11e5bc20abb3834810ee6edbcba2f8d816
---

 modules/access/pvr.c |   25 +++----------------------
 1 files changed, 3 insertions(+), 22 deletions(-)

diff --git a/modules/access/pvr.c b/modules/access/pvr.c
index f044cec..4f030d2 100644
--- a/modules/access/pvr.c
+++ b/modules/access/pvr.c
@@ -33,13 +33,13 @@
 #include <vlc_plugin.h>
 #include <vlc_access.h>
 #include <vlc_fs.h>
+#include <vlc_network.h>
 
 #include <sys/types.h>
 #include <fcntl.h>
 #include <unistd.h>
 #include <linux/types.h>
 #include <sys/ioctl.h>
-#include <sys/poll.h>
 #ifdef HAVE_NEW_LINUX_VIDEODEV2_H
 #   ifdef VIDEODEV2_H_FILE
 #   include VIDEODEV2_H_FILE
@@ -904,31 +904,12 @@ static void Close( vlc_object_t * p_this )
 static ssize_t Read( access_t * p_access, uint8_t * p_buffer, size_t i_len )
 {
     access_sys_t *p_sys = (access_sys_t *) p_access->p_sys;
-    struct pollfd ufd;
-    int i_ret;
-
-    ufd.fd = p_sys->i_fd;
-    ufd.events = POLLIN;
+    ssize_t i_ret;
 
     if( p_access->info.b_eof )
         return 0;
 
-    do
-    {
-        if( !vlc_object_alive (p_access) )
-            return 0;
-
-        ufd.revents = 0;
-    }
-    while( ( i_ret = poll( &ufd, 1, 500 ) ) == 0 );
-
-    if( i_ret < 0 )
-    {
-        msg_Err( p_access, "Polling error (%m)." );
-        return -1;
-    }
-
-    i_ret = read( p_sys->i_fd, p_buffer, i_len );
+    i_ret = net_Read( p_access, p_sys->i_fd, NULL, p_buffer, i_len, false );
     if( i_ret == 0 )
     {
         p_access->info.b_eof = true;



More information about the vlc-commits mailing list