[vlc-commits] dtv: use vlc_access_poll() (refs #8405)

Rémi Denis-Courmont git at videolan.org
Wed Feb 18 18:44:47 CET 2015


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Wed Feb 18 19:14:44 2015 +0200| [a768469f10459186cd5376098b59595ecd9682bd] | committer: Rémi Denis-Courmont

dtv: use vlc_access_poll() (refs #8405)

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

 modules/access/dtv/access.c     |    2 +-
 modules/access/dtv/bdagraph.cpp |    4 ++--
 modules/access/dtv/dtv.h        |    2 +-
 modules/access/dtv/linux.c      |   11 ++++++-----
 4 files changed, 10 insertions(+), 9 deletions(-)

diff --git a/modules/access/dtv/access.c b/modules/access/dtv/access.c
index f7d3bef..339e78a 100644
--- a/modules/access/dtv/access.c
+++ b/modules/access/dtv/access.c
@@ -455,7 +455,7 @@ static int Open (vlc_object_t *obj)
 
     var_LocationParse (obj, access->psz_location, "dvb-");
 
-    dvb_device_t *dev = dvb_open (obj);
+    dvb_device_t *dev = dvb_open (access);
     if (dev == NULL)
     {
         free (sys);
diff --git a/modules/access/dtv/bdagraph.cpp b/modules/access/dtv/bdagraph.cpp
index fd33a60..57db845 100644
--- a/modules/access/dtv/bdagraph.cpp
+++ b/modules/access/dtv/bdagraph.cpp
@@ -131,11 +131,11 @@ struct dvb_device
     uint32_t lowf, highf, switchf;
 };
 
-dvb_device_t *dvb_open (vlc_object_t *obj)
+dvb_device_t *dvb_open (access_t *obj)
 {
     dvb_device_t *d = new dvb_device_t;
 
-    d->module = new BDAGraph (obj);
+    d->module = new BDAGraph ((vlc_object_t *)obj);
     d->frequency = 0;
     d->srate = 0;
     d->fec = VLC_FEC_AUTO;
diff --git a/modules/access/dtv/dtv.h b/modules/access/dtv/dtv.h
index e218076..11df0fb 100644
--- a/modules/access/dtv/dtv.h
+++ b/modules/access/dtv/dtv.h
@@ -44,7 +44,7 @@ enum {
 
 typedef struct dvb_device dvb_device_t;
 
-dvb_device_t *dvb_open (vlc_object_t *obj);
+dvb_device_t *dvb_open (access_t *obj);
 void dvb_close (dvb_device_t *);
 ssize_t dvb_read (dvb_device_t *, void *, size_t);
 
diff --git a/modules/access/dtv/linux.c b/modules/access/dtv/linux.c
index 77789d7..f4690f5 100644
--- a/modules/access/dtv/linux.c
+++ b/modules/access/dtv/linux.c
@@ -26,6 +26,7 @@
 
 #include <vlc_common.h>
 #include <vlc_fs.h>
+#include <vlc_access.h>
 
 #include <errno.h>
 #include <assert.h>
@@ -145,7 +146,7 @@ static int dvb_parse_fec (uint32_t fec)
 
 struct dvb_device
 {
-    vlc_object_t *obj;
+    access_t *obj;
     int dir;
     int demux;
     int frontend;
@@ -186,7 +187,7 @@ static int dvb_open_node (dvb_device_t *d, const char *type, int flags)
 /**
  * Opens the DVB tuner
  */
-dvb_device_t *dvb_open (vlc_object_t *obj)
+dvb_device_t *dvb_open (access_t *obj)
 {
     dvb_device_t *d = malloc (sizeof (*d));
     if (unlikely(d == NULL))
@@ -265,7 +266,7 @@ dvb_device_t *dvb_open (vlc_object_t *obj)
     int ca = dvb_open_node (d, "ca", O_RDWR);
     if (ca != -1)
     {
-        d->cam = en50221_Init (obj, ca);
+        d->cam = en50221_Init (VLC_OBJECT(obj), ca);
         if (d->cam == NULL)
             close (ca);
     }
@@ -343,7 +344,7 @@ ssize_t dvb_read (dvb_device_t *d, void *buf, size_t len)
     else
         n = 1;
 
-    if (poll (ufd, n, 500 /* FIXME */) < 0)
+    if (vlc_access_poll (d->obj, ufd, n, -1) < 0)
         return -1;
 
     if (d->frontend != -1 && ufd[1].revents)
@@ -362,7 +363,7 @@ ssize_t dvb_read (dvb_device_t *d, void *buf, size_t len)
             return 0;
         }
 
-        dvb_frontend_status(d->obj, ev.status);
+        dvb_frontend_status(VLC_OBJECT(d->obj), ev.status);
     }
 
     if (ufd[0].revents)



More information about the vlc-commits mailing list