[vlc-commits] v4l2: radio: measure time from start (refs #7400)

Rémi Denis-Courmont git at videolan.org
Mon Sep 3 15:32:52 CEST 2012


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Mon Sep  3 16:32:58 2012 +0300| [edd2190a5b093c698c647b7ac163f3ae79464dbf] | committer: Rémi Denis-Courmont

v4l2: radio: measure time from start (refs #7400)

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

 modules/access/v4l2/radio.c |    6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/modules/access/v4l2/radio.c b/modules/access/v4l2/radio.c
index 17897e4..ec309ed 100644
--- a/modules/access/v4l2/radio.c
+++ b/modules/access/v4l2/radio.c
@@ -34,10 +34,13 @@ struct demux_sys_t
 {
     int fd;
     vlc_v4l2_ctrl_t *controls;
+    mtime_t start;
 };
 
 static int RadioControl (demux_t *demux, int query, va_list args)
 {
+    demux_sys_t *sys = demux->p_sys;
+
     switch (query)
     {
         case DEMUX_CAN_PAUSE:
@@ -52,7 +55,7 @@ static int RadioControl (demux_t *demux, int query, va_list args)
             break;
 
         case DEMUX_GET_TIME:
-            *va_arg (args, int64_t *) = mdate ();
+            *va_arg (args, int64_t *) = mdate () - sys->start;
             break;
 
         /* TODO implement others */
@@ -96,6 +99,7 @@ int RadioOpen (vlc_object_t *obj)
 
     sys->fd = fd;
     sys->controls = ControlsInit (VLC_OBJECT(demux), fd);
+    sys->start = mdate ();
 
     demux->p_sys = sys;
     demux->pf_demux = NULL;



More information about the vlc-commits mailing list