[vlc-commits] core: use vlc_tick_t for DEMUX_GET_TIME officially

Steve Lhomme git at videolan.org
Thu Sep 20 10:09:15 CEST 2018


vlc | branch: master | Steve Lhomme <robux4 at ycbcr.xyz> | Sat May  5 15:28:18 2018 +0200| [07666913ef3533acaf0f640a50af45e64b12d5dd] | committer: Steve Lhomme

core: use vlc_tick_t for DEMUX_GET_TIME officially

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

 include/vlc_demux.h                                |  2 +-
 modules/access/alsa.c                              |  2 +-
 modules/access/avcapture.m                         |  4 +---
 modules/access/bluray.c                            |  2 +-
 modules/access/dc1394.c                            |  2 +-
 modules/access/dcp/dcp.cpp                         |  3 +--
 modules/access/decklink.cpp                        |  6 ++----
 modules/access/dshow/dshow.cpp                     |  4 +---
 modules/access/dvdnav.c                            |  2 +-
 modules/access/dvdread.c                           |  5 ++---
 modules/access/imem.c                              |  3 +--
 modules/access/jack.c                              |  4 +---
 modules/access/live555.cpp                         |  3 +--
 modules/access/oss.c                               |  4 +---
 modules/access/pulse.c                             |  2 +-
 modules/access/rdp.c                               |  3 +--
 modules/access/rtp/rtp.c                           |  3 +--
 modules/access/screen/screen.c                     |  4 +---
 modules/access/screen/wayland.c                    |  2 +-
 modules/access/screen/xcb.c                        |  3 +--
 modules/access/shm.c                               |  3 +--
 modules/access/timecode.c                          |  2 +-
 modules/access/v4l2/demux.c                        |  2 +-
 modules/access/v4l2/radio.c                        |  2 +-
 modules/access/vnc.c                               |  3 +--
 modules/access/wasapi.c                            |  2 +-
 modules/demux/adaptive/PlaylistManager.cpp         |  2 +-
 modules/demux/asf/asf.c                            |  3 +--
 modules/demux/avformat/demux.c                     |  3 +--
 modules/demux/avi/avi.c                            |  3 +--
 modules/demux/caf.c                                |  4 ++--
 modules/demux/flac.c                               |  9 ++++-----
 modules/demux/gme.c                                |  3 +--
 modules/demux/image.c                              |  3 +--
 modules/demux/mkv/mkv.cpp                          |  3 +--
 modules/demux/mod.c                                |  3 +--
 modules/demux/mp4/heif.c                           |  2 +-
 modules/demux/mp4/mp4.c                            |  6 +-----
 modules/demux/mpc.c                                |  5 ++---
 modules/demux/mpeg/es.c                            |  3 +--
 modules/demux/mpeg/ps.c                            |  9 ++++-----
 modules/demux/mpeg/ts.c                            |  6 ++----
 modules/demux/nsv.c                                | 11 +++++------
 modules/demux/nuv.c                                |  5 ++---
 modules/demux/ogg.c                                |  3 +--
 modules/demux/pva.c                                |  2 +-
 modules/demux/sid.cpp                              |  5 +++--
 modules/demux/smf.c                                |  2 +-
 modules/demux/stl.c                                |  2 +-
 modules/demux/subtitle.c                           |  7 +++----
 modules/demux/tta.c                                |  7 +++----
 modules/demux/ttml.c                               |  3 +--
 modules/demux/ty.c                                 |  3 +--
 modules/demux/vobsub.c                             |  3 +--
 modules/demux/webvtt.c                             |  7 ++-----
 modules/stream_out/chromecast/chromecast_demux.cpp |  2 +-
 src/input/demux.c                                  |  3 +--
 src/input/demux_chained.c                          |  7 ++++---
 src/input/input.c                                  |  8 ++++----
 59 files changed, 88 insertions(+), 136 deletions(-)

diff --git a/include/vlc_demux.h b/include/vlc_demux.h
index 928aa0c77e..08e3742379 100644
--- a/include/vlc_demux.h
+++ b/include/vlc_demux.h
@@ -177,7 +177,7 @@ enum demux_query_e
 
     /* LENGTH/TIME in microsecond, 0 if unknown */
     DEMUX_GET_LENGTH,           /* arg1= int64_t *      res=    */
-    DEMUX_GET_TIME,             /* arg1= int64_t *      res=    */
+    DEMUX_GET_TIME,             /* arg1= vlc_tick_t *   res=    */
     DEMUX_SET_TIME,             /* arg1= int64_t arg2= bool b_precise   res=can fail    */
 
     /**
diff --git a/modules/access/alsa.c b/modules/access/alsa.c
index c54fd57aed..d6b8b98f9a 100644
--- a/modules/access/alsa.c
+++ b/modules/access/alsa.c
@@ -242,7 +242,7 @@ static int Control (demux_t *demux, int query, va_list ap)
     switch (query)
     {
         case DEMUX_GET_TIME:
-            *va_arg (ap, int64_t *) = vlc_tick_now () - sys->start;
+            *va_arg (ap, vlc_tick_t *) = vlc_tick_now () - sys->start;
             break;
 
         case DEMUX_GET_PTS_DELAY:
diff --git a/modules/access/avcapture.m b/modules/access/avcapture.m
index 8e070b7c07..ec0a05148b 100644
--- a/modules/access/avcapture.m
+++ b/modules/access/avcapture.m
@@ -436,7 +436,6 @@ static int Demux(demux_t *p_demux)
 static int Control(demux_t *p_demux, int i_query, va_list args)
 {
     bool        *pb;
-    int64_t     *pi64;
 
     switch( i_query )
     {
@@ -455,8 +454,7 @@ static int Control(demux_t *p_demux, int i_query, va_list args)
            return VLC_SUCCESS;
 
         case DEMUX_GET_TIME:
-            pi64 = va_arg(args, int64_t *);
-            *pi64 = vlc_tick_now();
+            *va_arg(args, vlc_tick_t *) = vlc_tick_now();
             return VLC_SUCCESS;
 
         default:
diff --git a/modules/access/bluray.c b/modules/access/bluray.c
index 5016f3d538..07fb464dd3 100644
--- a/modules/access/bluray.c
+++ b/modules/access/bluray.c
@@ -1951,7 +1951,7 @@ static int blurayControl(demux_t *p_demux, int query, va_list args)
     }
     case DEMUX_GET_TIME:
     {
-        int64_t *pi_time = va_arg(args, int64_t *);
+        vlc_tick_t *pi_time = va_arg(args, vlc_tick_t *);
         if(p_sys->cur_title < p_sys->i_title &&
            (CURRENT_TITLE->i_flags & INPUT_TITLE_INTERACTIVE))
                 return VLC_EGENERIC;
diff --git a/modules/access/dc1394.c b/modules/access/dc1394.c
index 82c2debd31..d994d37f2d 100644
--- a/modules/access/dc1394.c
+++ b/modules/access/dc1394.c
@@ -502,7 +502,7 @@ static int Control( demux_t *p_demux, int i_query, va_list args )
             return VLC_SUCCESS;
 
         case DEMUX_GET_TIME:
-            *va_arg( args, int64_t * ) = vlc_tick_now();
+            *va_arg( args, vlc_tick_t * ) = vlc_tick_now();
             return VLC_SUCCESS;
 
         /* TODO implement others */
diff --git a/modules/access/dcp/dcp.cpp b/modules/access/dcp/dcp.cpp
index bcd3517517..ddb2be8c00 100644
--- a/modules/access/dcp/dcp.cpp
+++ b/modules/access/dcp/dcp.cpp
@@ -820,8 +820,7 @@ static int Control( demux_t *p_demux, int query, va_list args )
             break;
 
         case DEMUX_GET_TIME:
-            pi64 = va_arg( args, int64_t * );
-            *pi64 = __MAX(p_sys->i_pts, 0);
+            *va_arg( args, vlc_tick_t * ) = __MAX(p_sys->i_pts, 0);
             break;
 
         case DEMUX_SET_TIME:
diff --git a/modules/access/decklink.cpp b/modules/access/decklink.cpp
index 2412750c31..ceadbb7724 100644
--- a/modules/access/decklink.cpp
+++ b/modules/access/decklink.cpp
@@ -150,7 +150,7 @@ struct demux_sys_t
     es_out_id_t *cc_es;
 
     vlc_mutex_t pts_lock;
-    int last_pts;  /* protected by <pts_lock> */
+    vlc_tick_t last_pts;  /* protected by <pts_lock> */
 
     uint32_t dominance_flags;
     int channels;
@@ -735,7 +735,6 @@ static int Control(demux_t *demux, int query, va_list args)
 {
     demux_sys_t *sys = (demux_sys_t *)demux->p_sys;
     bool *pb;
-    int64_t *pi64;
 
     switch(query)
     {
@@ -753,9 +752,8 @@ static int Control(demux_t *demux, int query, va_list args)
             return VLC_SUCCESS;
 
         case DEMUX_GET_TIME:
-            pi64 = va_arg(args, int64_t *);
             vlc_mutex_lock(&sys->pts_lock);
-            *pi64 = sys->last_pts;
+            *va_arg(args, vlc_tick_t *) = sys->last_pts;
             vlc_mutex_unlock(&sys->pts_lock);
             return VLC_SUCCESS;
 
diff --git a/modules/access/dshow/dshow.cpp b/modules/access/dshow/dshow.cpp
index 2a4183c5c3..2ec7875232 100644
--- a/modules/access/dshow/dshow.cpp
+++ b/modules/access/dshow/dshow.cpp
@@ -1949,7 +1949,6 @@ static int AccessControl( stream_t *p_access, int i_query, va_list args )
 static int DemuxControl( demux_t *p_demux, int i_query, va_list args )
 {
     bool    *pb;
-    int64_t *pi64;
 
     access_sys_t *p_sys = ( access_sys_t * ) p_demux->p_sys;
 
@@ -1970,8 +1969,7 @@ static int DemuxControl( demux_t *p_demux, int i_query, va_list args )
         return VLC_SUCCESS;
 
     case DEMUX_GET_TIME:
-        pi64 = va_arg( args, int64_t * );
-        *pi64 = vlc_tick_now() - p_sys->i_start;
+        *va_arg( args, vlc_tick_t * ) = vlc_tick_now() - p_sys->i_start;
         return VLC_SUCCESS;
 
     /* TODO implement others */
diff --git a/modules/access/dvdnav.c b/modules/access/dvdnav.c
index 9d81f3b907..505e92962b 100644
--- a/modules/access/dvdnav.c
+++ b/modules/access/dvdnav.c
@@ -561,7 +561,7 @@ static int Control( demux_t *p_demux, int i_query, va_list args )
             case DEMUX_GET_TIME:
                 if( p_sys->i_pgc_length > 0 )
                 {
-                    *va_arg( args, int64_t * ) = p_sys->i_pgc_length*pos/len;
+                    *va_arg( args, vlc_tick_t * ) = p_sys->i_pgc_length*pos/len;
                     return VLC_SUCCESS;
                 }
                 break;
diff --git a/modules/access/dvdread.c b/modules/access/dvdread.c
index 7357c5909b..74fb63682a 100644
--- a/modules/access/dvdread.c
+++ b/modules/access/dvdread.c
@@ -346,14 +346,13 @@ static int Control( demux_t *p_demux, int i_query, va_list args )
             return VLC_SUCCESS;
         }
         case DEMUX_GET_TIME:
-            pi64 = va_arg( args, int64_t * );
             if( p_sys->cur_title >= 0 && p_sys->cur_title < p_sys->i_titles )
             {
-                *pi64 = (int64_t) dvdtime_to_time( &p_sys->p_cur_pgc->playback_time ) /
+                *va_arg( args, vlc_tick_t * ) = dvdtime_to_time( &p_sys->p_cur_pgc->playback_time ) /
                         p_sys->i_title_blocks * p_sys->i_title_offset;
                 return VLC_SUCCESS;
             }
-            *pi64 = 0;
+            *va_arg( args, vlc_tick_t * ) = 0;
             return VLC_EGENERIC;
 
         case DEMUX_GET_LENGTH:
diff --git a/modules/access/imem.c b/modules/access/imem.c
index 3b42a65bd0..45b54feab1 100644
--- a/modules/access/imem.c
+++ b/modules/access/imem.c
@@ -537,8 +537,7 @@ static int ControlDemux(demux_t *demux, int i_query, va_list args)
         return VLC_SUCCESS;
     }
     case DEMUX_GET_TIME: {
-        int64_t *t = va_arg(args, int64_t *);
-        *t = sys->dts;
+        *va_arg(args, vlc_tick_t *) = sys->dts;
         return VLC_SUCCESS;
     }
     case DEMUX_GET_LENGTH: {
diff --git a/modules/access/jack.c b/modules/access/jack.c
index 1a91210757..b6f6d66d19 100644
--- a/modules/access/jack.c
+++ b/modules/access/jack.c
@@ -320,7 +320,6 @@ static void Close( vlc_object_t *p_this )
 static int Control( demux_t *p_demux, int i_query, va_list args )
 {
     bool *pb;
-    int64_t *pi64;
     demux_sys_t *p_sys = p_demux->p_sys;
 
     switch( i_query )
@@ -345,8 +344,7 @@ static int Control( demux_t *p_demux, int i_query, va_list args )
         return VLC_SUCCESS;
 
     case DEMUX_GET_TIME:
-        pi64 = va_arg( args, int64_t * );
-        *pi64 = date_Get(&p_sys->pts);
+        *va_arg( args, vlc_tick_t * ) = date_Get(&p_sys->pts);
         return VLC_SUCCESS;
 
     /* TODO implement others */
diff --git a/modules/access/live555.cpp b/modules/access/live555.cpp
index 0429d13323..45f7a8c25e 100644
--- a/modules/access/live555.cpp
+++ b/modules/access/live555.cpp
@@ -1527,10 +1527,9 @@ static int Control( demux_t *p_demux, int i_query, va_list args )
     switch( i_query )
     {
         case DEMUX_GET_TIME:
-            pi64 = va_arg( args, int64_t * );
             if( p_sys->f_npt > 0 )
             {
-                *pi64 = vlc_tick_from_sec(p_sys->f_npt);
+                *va_arg( args, vlc_tick_t * ) = vlc_tick_from_sec(p_sys->f_npt);
                 return VLC_SUCCESS;
             }
             return VLC_EGENERIC;
diff --git a/modules/access/oss.c b/modules/access/oss.c
index 28644481b7..c54ceb9eda 100644
--- a/modules/access/oss.c
+++ b/modules/access/oss.c
@@ -204,7 +204,6 @@ static int DemuxControl( demux_t *p_demux, int i_query, va_list args )
 {
     demux_sys_t *p_sys = p_demux->p_sys;
     bool *pb;
-    int64_t    *pi64;
 
     switch( i_query )
     {
@@ -222,8 +221,7 @@ static int DemuxControl( demux_t *p_demux, int i_query, va_list args )
             return VLC_SUCCESS;
 
         case DEMUX_GET_TIME:
-            pi64 = va_arg( args, int64_t * );
-            *pi64 = vlc_tick_now();
+            *va_arg( args, vlc_tick_t * ) = vlc_tick_now();
             return VLC_SUCCESS;
 
         case DEMUX_SET_NEXT_DEMUX_TIME:
diff --git a/modules/access/pulse.c b/modules/access/pulse.c
index f0d2773ee5..bcf3ae6b48 100644
--- a/modules/access/pulse.c
+++ b/modules/access/pulse.c
@@ -207,7 +207,7 @@ static int Control(demux_t *demux, int query, va_list ap)
 
             if (pa_stream_get_time(sys->stream, &us) < 0)
                 return VLC_EGENERIC;
-            *(va_arg(ap, int64_t *)) = us;
+            *(va_arg(ap, vlc_tick_t *)) = us * 10000000LL / CLOCK_FREQ;
             break;
         }
 
diff --git a/modules/access/rdp.c b/modules/access/rdp.c
index fb173ff258..afbdd80a66 100644
--- a/modules/access/rdp.c
+++ b/modules/access/rdp.c
@@ -307,8 +307,7 @@ static int Control( demux_t *p_demux, int i_query, va_list args )
             return VLC_SUCCESS;
 
         case DEMUX_GET_TIME:
-            pi64 = va_arg( args, int64_t * );
-            *pi64 = vlc_tick_now() - p_sys->i_starttime;
+            *va_arg( args, vlc_tick_t * ) = vlc_tick_now() - p_sys->i_starttime;
             return VLC_SUCCESS;
 
         case DEMUX_GET_LENGTH:
diff --git a/modules/access/rtp/rtp.c b/modules/access/rtp/rtp.c
index fb82815d93..fc41e73df2 100644
--- a/modules/access/rtp/rtp.c
+++ b/modules/access/rtp/rtp.c
@@ -412,8 +412,7 @@ static int Control (demux_t *demux, int query, va_list args)
         case DEMUX_GET_LENGTH:
         case DEMUX_GET_TIME:
         {
-            int64_t *v = va_arg (args, int64_t *);
-            *v = 0;
+            *va_arg (args, vlc_tick_t *) = 0;
             return VLC_SUCCESS;
         }
     }
diff --git a/modules/access/screen/screen.c b/modules/access/screen/screen.c
index 88ff50bd9c..2de12d3499 100644
--- a/modules/access/screen/screen.c
+++ b/modules/access/screen/screen.c
@@ -310,7 +310,6 @@ static int Demux( demux_t *p_demux )
 static int Control( demux_t *p_demux, int i_query, va_list args )
 {
     bool *pb;
-    int64_t *pi64;
     demux_sys_t *p_sys = p_demux->p_sys;
 
     switch( i_query )
@@ -330,8 +329,7 @@ static int Control( demux_t *p_demux, int i_query, va_list args )
             return VLC_SUCCESS;
 
         case DEMUX_GET_TIME:
-            pi64 = va_arg( args, int64_t * );
-            *pi64 = vlc_tick_now() - p_sys->i_start;
+            *va_arg( args, vlc_tick_t * ) = vlc_tick_now() - p_sys->i_start;
             return VLC_SUCCESS;
 
         /* TODO implement others */
diff --git a/modules/access/screen/wayland.c b/modules/access/screen/wayland.c
index 478d5a2cd1..bf81fb76a1 100644
--- a/modules/access/screen/wayland.c
+++ b/modules/access/screen/wayland.c
@@ -289,7 +289,7 @@ static int Control(demux_t *demux, int query, va_list args)
             break;
 
         case DEMUX_GET_TIME:
-            *va_arg(args, int64_t *) = vlc_tick_now() - sys->start;
+            *va_arg(args, vlc_tick_t *) = vlc_tick_now() - sys->start;
             break;
 
         case DEMUX_GET_FPS:
diff --git a/modules/access/screen/xcb.c b/modules/access/screen/xcb.c
index 27712d0ec2..df7bd2e1b6 100644
--- a/modules/access/screen/xcb.c
+++ b/modules/access/screen/xcb.c
@@ -292,8 +292,7 @@ static int Control (demux_t *demux, int query, va_list args)
         case DEMUX_GET_LENGTH:
         case DEMUX_GET_TIME:
         {
-            int64_t *v = va_arg (args, int64_t *);
-            *v = 0;
+            *va_arg (args, vlc_tick_t *) = 0;
             return VLC_SUCCESS;
         }
 
diff --git a/modules/access/shm.c b/modules/access/shm.c
index 70c3f781f8..1b12bf6e92 100644
--- a/modules/access/shm.c
+++ b/modules/access/shm.c
@@ -287,8 +287,7 @@ static int Control (demux_t *demux, int query, va_list args)
         case DEMUX_GET_LENGTH:
         case DEMUX_GET_TIME:
         {
-            int64_t *v = va_arg (args, int64_t *);
-            *v = 0;
+            *va_arg (args, vlc_tick_t *) = 0;
             return VLC_SUCCESS;
         }
 
diff --git a/modules/access/timecode.c b/modules/access/timecode.c
index 751c357beb..d82f116998 100644
--- a/modules/access/timecode.c
+++ b/modules/access/timecode.c
@@ -125,7 +125,7 @@ static int Control (demux_t *demux, int query, va_list args)
             break;
 
         case DEMUX_GET_TIME:
-            *va_arg (args, int64_t *) = date_Get (&sys->date);
+            *va_arg (args, vlc_tick_t *) = date_Get (&sys->date);
             break;
 
         case DEMUX_SET_TIME:
diff --git a/modules/access/v4l2/demux.c b/modules/access/v4l2/demux.c
index add82c30fb..961ec32840 100644
--- a/modules/access/v4l2/demux.c
+++ b/modules/access/v4l2/demux.c
@@ -853,7 +853,7 @@ static int DemuxControl( demux_t *demux, int query, va_list args )
             return VLC_SUCCESS;
 
         case DEMUX_GET_TIME:
-            *va_arg (args, int64_t *) = vlc_tick_now() - sys->start;
+            *va_arg (args, vlc_tick_t *) = vlc_tick_now() - sys->start;
             return VLC_SUCCESS;
 
         /* TODO implement others */
diff --git a/modules/access/v4l2/radio.c b/modules/access/v4l2/radio.c
index 1f45fe5a33..6df6c35ce7 100644
--- a/modules/access/v4l2/radio.c
+++ b/modules/access/v4l2/radio.c
@@ -55,7 +55,7 @@ static int RadioControl (demux_t *demux, int query, va_list args)
             break;
 
         case DEMUX_GET_TIME:
-            *va_arg (args, int64_t *) = vlc_tick_now () - sys->start;
+            *va_arg (args, vlc_tick_t *) = vlc_tick_now () - sys->start;
             break;
 
         /* TODO implement others */
diff --git a/modules/access/vnc.c b/modules/access/vnc.c
index 28084a4d18..4f7fbf857a 100644
--- a/modules/access/vnc.c
+++ b/modules/access/vnc.c
@@ -304,8 +304,7 @@ static int Control( demux_t *p_demux, int i_query, va_list args )
             return VLC_SUCCESS;
 
         case DEMUX_GET_TIME:
-            pi64 = va_arg( args, int64_t * );
-            *pi64 = vlc_tick_now() - p_sys->i_starttime;
+            *va_arg( args, vlc_tick_t * ) = vlc_tick_now() - p_sys->i_starttime;
             return VLC_SUCCESS;
 
         case DEMUX_GET_LENGTH:
diff --git a/modules/access/wasapi.c b/modules/access/wasapi.c
index 98ea1ee217..68ddca33f6 100644
--- a/modules/access/wasapi.c
+++ b/modules/access/wasapi.c
@@ -356,7 +356,7 @@ static int Control(demux_t *demux, int query, va_list ap)
     switch (query)
     {
         case DEMUX_GET_TIME:
-            *(va_arg(ap, int64_t *)) = vlc_tick_now() - sys->start_time;
+            *(va_arg(ap, vlc_tick_t *)) = vlc_tick_now() - sys->start_time;
             break;
 
         case DEMUX_GET_PTS_DELAY:
diff --git a/modules/demux/adaptive/PlaylistManager.cpp b/modules/demux/adaptive/PlaylistManager.cpp
index 916daf9d1c..491427f17d 100644
--- a/modules/demux/adaptive/PlaylistManager.cpp
+++ b/modules/demux/adaptive/PlaylistManager.cpp
@@ -528,7 +528,7 @@ int PlaylistManager::doControl(int i_query, va_list args)
         case DEMUX_GET_TIME:
         {
             vlc_mutex_locker locker(&cached.lock);
-            *(va_arg (args, int64_t *)) = cached.i_time;
+            *(va_arg (args, vlc_tick_t *)) = cached.i_time;
             break;
         }
 
diff --git a/modules/demux/asf/asf.c b/modules/demux/asf/asf.c
index 30786754a5..0532fea76e 100644
--- a/modules/demux/asf/asf.c
+++ b/modules/demux/asf/asf.c
@@ -425,9 +425,8 @@ static int Control( demux_t *p_demux, int i_query, va_list args )
         return VLC_SUCCESS;
 
     case DEMUX_GET_TIME:
-        pi64 = va_arg( args, int64_t * );
         if( p_sys->i_time == VLC_TICK_INVALID ) return VLC_EGENERIC;
-        *pi64 = p_sys->i_time;
+        *va_arg( args, vlc_tick_t * ) = p_sys->i_time;
         return VLC_SUCCESS;
 
     case DEMUX_SET_TIME:
diff --git a/modules/demux/avformat/demux.c b/modules/demux/avformat/demux.c
index 9278251067..b92079e720 100644
--- a/modules/demux/avformat/demux.c
+++ b/modules/demux/avformat/demux.c
@@ -1066,8 +1066,7 @@ static int Control( demux_t *p_demux, int i_query, va_list args )
             return VLC_SUCCESS;
 
         case DEMUX_GET_TIME:
-            pi64 = va_arg( args, int64_t * );
-            *pi64 = p_sys->i_pcr;
+            *va_arg( args, vlc_tick_t * ) = p_sys->i_pcr;
             return VLC_SUCCESS;
 
         case DEMUX_SET_TIME:
diff --git a/modules/demux/avi/avi.c b/modules/demux/avi/avi.c
index 52e048d9fa..bf39154167 100644
--- a/modules/demux/avi/avi.c
+++ b/modules/demux/avi/avi.c
@@ -1618,8 +1618,7 @@ static int Control( demux_t *p_demux, int i_query, va_list args )
             }
 
         case DEMUX_GET_TIME:
-            pi64 = va_arg( args, int64_t * );
-            *pi64 = p_sys->i_time;
+            *va_arg( args, vlc_tick_t * ) = p_sys->i_time;
             return VLC_SUCCESS;
 
         case DEMUX_SET_TIME:
diff --git a/modules/demux/caf.c b/modules/demux/caf.c
index 441763896a..dda7f83142 100644
--- a/modules/demux/caf.c
+++ b/modules/demux/caf.c
@@ -1021,8 +1021,8 @@ static int Control( demux_t *p_demux, int i_query, va_list args )
             return VLC_SUCCESS;
 
         case DEMUX_GET_TIME:
-            pi64 = va_arg( args, int64_t * );
-            *pi64 = CLOCK_FREQ * ( p_sys->position.i_samples / p_sys->fmt.audio.i_rate );
+            *va_arg( args, vlc_tick_t * ) =
+                CLOCK_FREQ * ( p_sys->position.i_samples / p_sys->fmt.audio.i_rate );
             return VLC_SUCCESS;
 
         case DEMUX_GET_POSITION:
diff --git a/modules/demux/flac.c b/modules/demux/flac.c
index 2a7230ed74..1184bd6fab 100644
--- a/modules/demux/flac.c
+++ b/modules/demux/flac.c
@@ -434,7 +434,7 @@ static int64_t ControlGetLength( demux_t *p_demux )
     return i_length;
 }
 
-static int64_t ControlGetTime( demux_t *p_demux )
+static vlc_tick_t ControlGetTime( demux_t *p_demux )
 {
     demux_sys_t *p_sys = p_demux->p_sys;
     return p_sys->i_pts;
@@ -552,8 +552,7 @@ static int Control( demux_t *p_demux, int i_query, va_list args )
     }
     else if( i_query == DEMUX_GET_TIME )
     {
-        int64_t *pi64 = va_arg( args, int64_t * );
-        *pi64 = ControlGetTime( p_demux );
+        *va_arg( args, vlc_tick_t * ) = ControlGetTime( p_demux );
         return VLC_SUCCESS;
     }
     else if( i_query == DEMUX_GET_POSITION )
@@ -561,10 +560,10 @@ static int Control( demux_t *p_demux, int i_query, va_list args )
         const int64_t i_length = ControlGetLength(p_demux);
         if( i_length > 0 )
         {
-            double current = ControlGetTime(p_demux);
+            vlc_tick_t current = ControlGetTime(p_demux);
             if( current <= i_length )
             {
-                *(va_arg( args, double * )) = current / (double)i_length;
+                *(va_arg( args, double * )) = (double)current / (double)i_length;
                 return VLC_SUCCESS;
             }
         }
diff --git a/modules/demux/gme.c b/modules/demux/gme.c
index 6fc9018603..abc432f1e2 100644
--- a/modules/demux/gme.c
+++ b/modules/demux/gme.c
@@ -291,8 +291,7 @@ static int Control (demux_t *demux, int query, va_list args)
 
         case DEMUX_GET_TIME:
         {
-            int64_t *v = va_arg (args, int64_t *);
-            *v = gme_tell (sys->emu) * INT64_C(1000);
+            *va_arg (args, vlc_tick_t *) = VLC_TICK_FROM_MS(gme_tell (sys->emu));
             return VLC_SUCCESS;
         }
 
diff --git a/modules/demux/image.c b/modules/demux/image.c
index 4220383c28..6949cb803f 100644
--- a/modules/demux/image.c
+++ b/modules/demux/image.c
@@ -255,8 +255,7 @@ static int Control(demux_t *demux, int query, va_list args)
         return VLC_SUCCESS;
     }
     case DEMUX_GET_TIME: {
-        int64_t *time = va_arg(args, int64_t *);
-        *time = sys->pts_offset + date_Get(&sys->pts);
+        *va_arg(args, vlc_tick_t *) = sys->pts_offset + date_Get(&sys->pts);
         return VLC_SUCCESS;
     }
     case DEMUX_SET_TIME: {
diff --git a/modules/demux/mkv/mkv.cpp b/modules/demux/mkv/mkv.cpp
index 2e37e72dcf..c97a490fc1 100644
--- a/modules/demux/mkv/mkv.cpp
+++ b/modules/demux/mkv/mkv.cpp
@@ -355,8 +355,7 @@ static int Control( demux_t *p_demux, int i_query, va_list args )
             return VLC_EGENERIC;
 
         case DEMUX_GET_TIME:
-            pi64 = va_arg( args, int64_t * );
-            *pi64 = p_sys->i_pcr;
+            *va_arg( args, vlc_tick_t * ) = p_sys->i_pcr;
             return VLC_SUCCESS;
 
         case DEMUX_GET_TITLE_INFO:
diff --git a/modules/demux/mod.c b/modules/demux/mod.c
index 1956a1aa29..c64cab14e4 100644
--- a/modules/demux/mod.c
+++ b/modules/demux/mod.c
@@ -325,8 +325,7 @@ static int Control( demux_t *p_demux, int i_query, va_list args )
         return VLC_EGENERIC;
 
     case DEMUX_GET_TIME:
-        pi64 = va_arg( args, int64_t * );
-        *pi64 = date_Get( &p_sys->pts );
+        *va_arg( args, vlc_tick_t * ) = date_Get( &p_sys->pts );
         return VLC_SUCCESS;
 
     case DEMUX_GET_LENGTH:
diff --git a/modules/demux/mp4/heif.c b/modules/demux/mp4/heif.c
index f7dffcd2a5..c3794d043e 100644
--- a/modules/demux/mp4/heif.c
+++ b/modules/demux/mp4/heif.c
@@ -181,7 +181,7 @@ static int ControlHEIF( demux_t *p_demux, int i_query, va_list args )
                                            p_sys->i_image_duration;
             return VLC_SUCCESS;
         case DEMUX_GET_TIME:
-            *(va_arg(args, int64_t *)) = p_sys->i_pcr;
+            *(va_arg(args, vlc_tick_t *)) = p_sys->i_pcr;
             return VLC_SUCCESS;
         case DEMUX_SET_TIME:
         {
diff --git a/modules/demux/mp4/mp4.c b/modules/demux/mp4/mp4.c
index 2ec50430e8..109cf34dab 100644
--- a/modules/demux/mp4/mp4.c
+++ b/modules/demux/mp4/mp4.c
@@ -1988,11 +1988,7 @@ static int Control( demux_t *p_demux, int i_query, va_list args )
             else return VLC_EGENERIC;
 
         case DEMUX_GET_TIME:
-            pi64 = va_arg( args, int64_t * );
-            if( p_sys->i_timescale > 0 )
-                *pi64 = p_sys->i_nztime;
-            else
-                *pi64 = 0;
+            *va_arg( args, vlc_tick_t * ) = p_sys->i_timescale > 0 ? p_sys->i_nztime : 0;
             return VLC_SUCCESS;
 
         case DEMUX_SET_TIME:
diff --git a/modules/demux/mpc.c b/modules/demux/mpc.c
index f381c7dce3..e3ea8726bb 100644
--- a/modules/demux/mpc.c
+++ b/modules/demux/mpc.c
@@ -289,9 +289,8 @@ static int Control( demux_t *p_demux, int i_query, va_list args )
             return VLC_SUCCESS;
 
         case DEMUX_GET_TIME:
-            pi64 = va_arg( args, int64_t * );
-            *pi64 = CLOCK_FREQ * p_sys->i_position /
-                        p_sys->info.sample_freq;
+            *va_arg( args, vlc_tick_t * ) =
+                CLOCK_FREQ * p_sys->i_position / p_sys->info.sample_freq;
             return VLC_SUCCESS;
 
         case DEMUX_SET_POSITION:
diff --git a/modules/demux/mpeg/es.c b/modules/demux/mpeg/es.c
index 6f2389c036..02a284f469 100644
--- a/modules/demux/mpeg/es.c
+++ b/modules/demux/mpeg/es.c
@@ -400,8 +400,7 @@ static int Control( demux_t *p_demux, int i_query, va_list args )
             return VLC_SUCCESS;
 
         case DEMUX_GET_TIME:
-            pi64 = va_arg( args, int64_t * );
-            *pi64 = p_sys->i_pts + p_sys->i_time_offset;
+            *va_arg( args, vlc_tick_t * ) = p_sys->i_pts + p_sys->i_time_offset;
             return VLC_SUCCESS;
 
         case DEMUX_GET_LENGTH:
diff --git a/modules/demux/mpeg/ps.c b/modules/demux/mpeg/ps.c
index 5da67059d8..e5b998a911 100644
--- a/modules/demux/mpeg/ps.c
+++ b/modules/demux/mpeg/ps.c
@@ -729,24 +729,23 @@ static int Control( demux_t *p_demux, int i_query, va_list args )
             break;
 
         case DEMUX_GET_TIME:
-            pi64 = va_arg( args, int64_t * );
             if( p_sys->i_time_track_index >= 0 && p_sys->i_current_pts != VLC_TICK_INVALID )
             {
-                *pi64 = p_sys->i_current_pts - p_sys->tk[p_sys->i_time_track_index].i_first_pts;
+                *va_arg( args, vlc_tick_t * ) = p_sys->i_current_pts - p_sys->tk[p_sys->i_time_track_index].i_first_pts;
                 return VLC_SUCCESS;
             }
             if( p_sys->i_first_scr != VLC_TICK_INVALID && p_sys->i_scr != VLC_TICK_INVALID )
             {
-                *pi64 = p_sys->i_scr - p_sys->i_first_scr;
+                *va_arg( args, vlc_tick_t * ) = p_sys->i_scr - p_sys->i_first_scr;
                 /* H.222 2.5.2.2 */
                 if( p_sys->i_mux_rate > 0 && p_sys->b_have_pack )
                 {
                     uint64_t i_offset = vlc_stream_Tell( p_demux->s ) - p_sys->i_lastpack_byte;
-                    *pi64 += CLOCK_FREQ * i_offset / (p_sys->i_mux_rate * 50);
+                    *va_arg( args, vlc_tick_t * ) += CLOCK_FREQ * i_offset / (p_sys->i_mux_rate * 50);
                 }
                 return VLC_SUCCESS;
             }
-            *pi64 = 0;
+            *va_arg( args, vlc_tick_t * ) = 0;
             break;
 
         case DEMUX_GET_LENGTH:
diff --git a/modules/demux/mpeg/ts.c b/modules/demux/mpeg/ts.c
index 91beffd995..54f9a594b4 100644
--- a/modules/demux/mpeg/ts.c
+++ b/modules/demux/mpeg/ts.c
@@ -1011,14 +1011,12 @@ static int Control( demux_t *p_demux, int i_query, va_list args )
         break;
 
     case DEMUX_GET_TIME:
-        pi64 = va_arg( args, int64_t * );
-
         if( p_sys->b_access_control )
         {
             time_t i_event_start;
             if( !EITCurrentEventTime( p_pmt, p_sys, &i_event_start, NULL ) )
             {
-                *pi64 = vlc_tick_from_sec( i_event_start );
+                *va_arg( args, vlc_tick_t * ) = vlc_tick_from_sec( i_event_start );
                 return VLC_SUCCESS;
             }
         }
@@ -1026,7 +1024,7 @@ static int Control( demux_t *p_demux, int i_query, va_list args )
         if( p_pmt && p_pmt->pcr.i_current > -1 && p_pmt->pcr.i_first > -1 )
         {
             stime_t i_pcr = TimeStampWrapAround( p_pmt->pcr.i_first, p_pmt->pcr.i_current );
-            *pi64 = FROM_SCALE(i_pcr - p_pmt->pcr.i_first);
+            *va_arg( args, vlc_tick_t * ) = FROM_SCALE(i_pcr - p_pmt->pcr.i_first);
             return VLC_SUCCESS;
         }
         break;
diff --git a/modules/demux/nsv.c b/modules/demux/nsv.c
index 57ab658a28..0bb88d6837 100644
--- a/modules/demux/nsv.c
+++ b/modules/demux/nsv.c
@@ -69,9 +69,9 @@ typedef struct
     es_format_t  fmt_sub;
     es_out_id_t  *p_sub;
 
-    int64_t     i_pcr;
-    int64_t     i_time;
-    int64_t     i_pcr_inc;
+    vlc_tick_t  i_pcr;
+    vlc_tick_t  i_time;
+    vlc_tick_t  i_pcr_inc;
 
     bool b_start_record;
 } demux_sys_t;
@@ -380,13 +380,12 @@ static int Control( demux_t *p_demux, int i_query, va_list args )
             return VLC_SUCCESS;
 
         case DEMUX_GET_TIME:
-            pi64 = va_arg( args, int64_t * );
             if( p_sys->i_time < 0 )
             {
-                *pi64 = 0;
+                *va_arg( args, vlc_tick_t * ) = 0;
                 return VLC_EGENERIC;
             }
-            *pi64 = p_sys->i_time;
+            *va_arg( args, vlc_tick_t * ) = p_sys->i_time;
             return VLC_SUCCESS;
 
 #if 0
diff --git a/modules/demux/nuv.c b/modules/demux/nuv.c
index cc057d3c46..47956bdf91 100644
--- a/modules/demux/nuv.c
+++ b/modules/demux/nuv.c
@@ -175,7 +175,7 @@ typedef struct
     header_t          hdr;
     extended_header_t exh;
 
-    int64_t     i_pcr;
+    vlc_tick_t  i_pcr;
     es_out_id_t *p_es_video;
     int         i_extra_f;
     uint8_t     *p_extra_f;
@@ -503,8 +503,7 @@ static int Control( demux_t *p_demux, int i_query, va_list args )
         }
 
         case DEMUX_GET_TIME:
-            pi64 = va_arg( args, int64_t * );
-            *pi64 = p_sys->i_pcr >= 0 ? p_sys->i_pcr : 0;
+            *va_arg( args, vlc_tick_t * ) = __MAX(p_sys->i_pcr, 0);
             return VLC_SUCCESS;
 
         case DEMUX_SET_TIME:
diff --git a/modules/demux/ogg.c b/modules/demux/ogg.c
index 863c1a5e54..01a80fd9d1 100644
--- a/modules/demux/ogg.c
+++ b/modules/demux/ogg.c
@@ -698,8 +698,7 @@ static int Control( demux_t *p_demux, int i_query, va_list args )
         case DEMUX_GET_TIME:
             if( p_sys->i_pcr != VLC_TICK_INVALID || p_sys->b_slave )
             {
-                pi64 = va_arg( args, int64_t * );
-                *pi64 = p_sys->i_pcr;
+                *va_arg( args, vlc_tick_t * ) = p_sys->i_pcr;
                 return VLC_SUCCESS;
             }
             return VLC_EGENERIC;
diff --git a/modules/demux/pva.c b/modules/demux/pva.c
index e796c0181d..aabcd7ae34 100644
--- a/modules/demux/pva.c
+++ b/modules/demux/pva.c
@@ -321,7 +321,7 @@ static int Control( demux_t *p_demux, int i_query, va_list args )
 
 #if 0
         case DEMUX_GET_TIME:
-            pi64 = va_arg( args, int64_t * );
+            pi64 = va_arg( args, vlc_tick_t * );
             if( p_sys->i_time < 0 )
             {
                 *pi64 = 0;
diff --git a/modules/demux/sid.cpp b/modules/demux/sid.cpp
index 26df2de12c..3ddec12115 100644
--- a/modules/demux/sid.cpp
+++ b/modules/demux/sid.cpp
@@ -243,8 +243,9 @@ static int Control (demux_t *demux, int query, va_list args)
     switch (query)
     {
         case DEMUX_GET_TIME : {
-            int64_t *v = va_arg (args, int64_t*);
-            *v = sys->player->time() * sys->player->timebase() * VLC_TICK_FROM_MS(10);
+            /* FIXME resolution in 100ns? */
+            *va_arg (args, vlc_tick_t*) =
+                sys->player->time() * sys->player->timebase() * VLC_TICK_FROM_MS(10);
             return VLC_SUCCESS;
         }
 
diff --git a/modules/demux/smf.c b/modules/demux/smf.c
index 58cb75b446..b6e70d60c4 100644
--- a/modules/demux/smf.c
+++ b/modules/demux/smf.c
@@ -520,7 +520,7 @@ static int Control (demux_t *demux, int i_query, va_list args)
             *va_arg (args, int64_t *) = sys->duration;
             break;
         case DEMUX_GET_TIME:
-            *va_arg (args, int64_t *) = sys->tick - VLC_TICK_0;
+            *va_arg (args, vlc_tick_t *) = sys->tick - VLC_TICK_0;
             break;
         case DEMUX_SET_TIME:
             return Seek (demux, va_arg (args, int64_t));
diff --git a/modules/demux/stl.c b/modules/demux/stl.c
index dcacce1b7d..406be31e2d 100644
--- a/modules/demux/stl.c
+++ b/modules/demux/stl.c
@@ -107,7 +107,7 @@ static int Control(demux_t *demux, int query, va_list args)
         return VLC_SUCCESS;
     }
     case DEMUX_GET_TIME: {
-        int64_t *t = va_arg(args, int64_t *);
+        vlc_tick_t *t = va_arg(args, vlc_tick_t *);
         *t = sys->next_date - var_GetInteger(demux->obj.parent, "spu-delay");
         if( *t < 0 )
             *t = sys->next_date;
diff --git a/modules/demux/subtitle.c b/modules/demux/subtitle.c
index 8e6e48db35..c97403c2bb 100644
--- a/modules/demux/subtitle.c
+++ b/modules/demux/subtitle.c
@@ -767,10 +767,9 @@ static int Control( demux_t *p_demux, int i_query, va_list args )
             return VLC_SUCCESS;
 
         case DEMUX_GET_TIME:
-            pi64 = va_arg( args, int64_t * );
-            *pi64 = p_sys->i_next_demux_date - var_GetInteger( p_demux->obj.parent, "spu-delay" );
-            if( *pi64 < 0 )
-               *pi64 = p_sys->i_next_demux_date;
+            *va_arg( args, vlc_tick_t * ) = p_sys->i_next_demux_date - var_GetInteger( p_demux->obj.parent, "spu-delay" );
+            if( *va_arg( args, vlc_tick_t * ) < 0 )
+               *va_arg( args, vlc_tick_t * ) = p_sys->i_next_demux_date;
             return VLC_SUCCESS;
 
         case DEMUX_SET_TIME:
diff --git a/modules/demux/tta.c b/modules/demux/tta.c
index 187065eb17..1aec0921db 100644
--- a/modules/demux/tta.c
+++ b/modules/demux/tta.c
@@ -265,13 +265,12 @@ static int Control( demux_t *p_demux, int i_query, va_list args )
             return VLC_EGENERIC;
 
         case DEMUX_GET_LENGTH:
-            pi64 = va_arg( args, int64_t * );
-            *pi64 = vlc_tick_from_sec( p_sys->i_totalframes * TTA_FRAMETIME );
+            *va_arg( args, vlc_tick_t * ) =
+                vlc_tick_from_sec( p_sys->i_totalframes * TTA_FRAMETIME );
             return VLC_SUCCESS;
 
         case DEMUX_GET_TIME:
-            pi64 = va_arg( args, int64_t * );
-            *pi64 = vlc_tick_from_sec( p_sys->i_currentframe * TTA_FRAMETIME );
+            *va_arg( args, vlc_tick_t * ) = vlc_tick_from_sec( p_sys->i_currentframe * TTA_FRAMETIME );
             return VLC_SUCCESS;
 
         case DEMUX_CAN_PAUSE:
diff --git a/modules/demux/ttml.c b/modules/demux/ttml.c
index cb654320d0..9aa69bef44 100644
--- a/modules/demux/ttml.c
+++ b/modules/demux/ttml.c
@@ -217,8 +217,7 @@ static int Control( demux_t* p_demux, int i_query, va_list args )
             *va_arg( args, bool * ) = true;
             return VLC_SUCCESS;
         case DEMUX_GET_TIME:
-            pi64 = va_arg( args, int64_t * );
-            *pi64 = p_sys->i_next_demux_time;
+            *va_arg( args, vlc_tick_t * ) = p_sys->i_next_demux_time;
             return VLC_SUCCESS;
         case DEMUX_SET_TIME:
             i64 = va_arg( args, int64_t );
diff --git a/modules/demux/ty.c b/modules/demux/ty.c
index c5eed4b846..75c3417b08 100644
--- a/modules/demux/ty.c
+++ b/modules/demux/ty.c
@@ -519,11 +519,10 @@ static int Control(demux_t *p_demux, int i_query, va_list args)
         return VLC_EGENERIC;
     case DEMUX_GET_TIME:
         /* return TiVo timestamp */
-        p_i64 = va_arg(args, int64_t *);
         //*p_i64 = p_sys->lastAudioPTS - p_sys->firstAudioPTS;
         //*p_i64 = (p_sys->l_last_ty_pts / 1000) + (p_sys->lastAudioPTS -
         //    p_sys->l_last_ty_pts_sync);
-        *p_i64 = (p_sys->l_last_ty_pts / 1000);
+        *va_arg(args, vlc_tick_t *) = VLC_TICK_FROM_NS(p_sys->l_last_ty_pts);
         return VLC_SUCCESS;
     case DEMUX_GET_LENGTH:    /* length of program in microseconds, 0 if unk */
         /* size / bitrate */
diff --git a/modules/demux/vobsub.c b/modules/demux/vobsub.c
index 777573e59e..cedb81dd9c 100644
--- a/modules/demux/vobsub.c
+++ b/modules/demux/vobsub.c
@@ -254,7 +254,6 @@ static int Control( demux_t *p_demux, int i_query, va_list args )
             return VLC_SUCCESS;
 
         case DEMUX_GET_TIME:
-            pi64 = va_arg( args, int64_t * );
             for( i = 0; i < p_sys->i_tracks; i++ )
             {
                 bool b_selected;
@@ -265,7 +264,7 @@ static int Control( demux_t *p_demux, int i_query, va_list args )
             }
             if( i < p_sys->i_tracks && p_sys->track[i].i_current_subtitle < p_sys->track[i].i_subtitles )
             {
-                *pi64 = p_sys->track[i].p_subtitles[p_sys->track[i].i_current_subtitle].i_start;
+                *va_arg( args, vlc_tick_t * ) = p_sys->track[i].p_subtitles[p_sys->track[i].i_current_subtitle].i_start;
                 return VLC_SUCCESS;
             }
             return VLC_EGENERIC;
diff --git a/modules/demux/webvtt.c b/modules/demux/webvtt.c
index cfc7915691..d446ef12cc 100644
--- a/modules/demux/webvtt.c
+++ b/modules/demux/webvtt.c
@@ -435,8 +435,7 @@ static int Control( demux_t *p_demux, int i_query, va_list args )
             return VLC_SUCCESS;
 
         case DEMUX_GET_TIME:
-            pi64 = va_arg( args, int64_t * );
-            *pi64 = p_sys->i_next_demux_time;
+            *va_arg( args, vlc_tick_t * ) = p_sys->i_next_demux_time;
             return VLC_SUCCESS;
 
         case DEMUX_SET_TIME:
@@ -508,15 +507,13 @@ static int Control( demux_t *p_demux, int i_query, va_list args )
 static int ControlStream( demux_t *p_demux, int i_query, va_list args )
 {
     demux_sys_t *p_sys = p_demux->p_sys;
-    int64_t *pi64;
 
     switch( i_query )
     {
         case DEMUX_GET_TIME:
-            pi64 = va_arg( args, int64_t * );
             if( p_sys->i_next_demux_time != VLC_TICK_INVALID )
             {
-                *pi64 = p_sys->i_next_demux_time;
+                *va_arg( args, vlc_tick_t * ) = p_sys->i_next_demux_time;
                 return VLC_SUCCESS;
             }
         default:
diff --git a/modules/stream_out/chromecast/chromecast_demux.cpp b/modules/stream_out/chromecast/chromecast_demux.cpp
index cf860d8d8a..b4b5e8c4a6 100644
--- a/modules/stream_out/chromecast/chromecast_demux.cpp
+++ b/modules/stream_out/chromecast/chromecast_demux.cpp
@@ -320,7 +320,7 @@ struct demux_cc
             vlc_tick_t time = getTime();
             if( time >= 0 )
             {
-                *va_arg(args, int64_t *) = time;
+                *va_arg(args, vlc_tick_t *) = time;
                 return VLC_SUCCESS;
             }
             return VLC_EGENERIC;
diff --git a/src/input/demux.c b/src/input/demux.c
index 3631e08984..e3cb7c6e99 100644
--- a/src/input/demux.c
+++ b/src/input/demux.c
@@ -319,10 +319,9 @@ int demux_vaControlHelper( stream_t *s,
             return VLC_EGENERIC;
 
         case DEMUX_GET_TIME:
-            pi64 = (int64_t*)va_arg( args, int64_t * );
             if( i_bitrate > 0 && i_tell >= i_start )
             {
-                *pi64 = INT64_C(8000000) * (i_tell - i_start) / i_bitrate;
+                *va_arg( args, vlc_tick_t * ) = INT64_C(8000000) * (i_tell - i_start) / i_bitrate;
                 return VLC_SUCCESS;
             }
             return VLC_EGENERIC;
diff --git a/src/input/demux_chained.c b/src/input/demux_chained.c
index a3323b68fa..5fe1d56afa 100644
--- a/src/input/demux_chained.c
+++ b/src/input/demux_chained.c
@@ -43,7 +43,7 @@ struct vlc_demux_chained_t
     {
         double  position;
         int64_t length;
-        int64_t time;
+        vlc_tick_t time;
     } stats;
 
     es_out_t *out;
@@ -72,7 +72,8 @@ static void *vlc_demux_chained_Thread(void *data)
         if (demux_TestAndClearFlags(demux, UINT_MAX) || vlc_tick_now() >= next_update)
         {
             double newpos;
-            int64_t newlen, newtime;
+            int64_t newlen;
+            vlc_tick_t newtime;
 
             if (demux_Control(demux, DEMUX_GET_POSITION, &newpos))
                 newpos = 0.;
@@ -150,7 +151,7 @@ int vlc_demux_chained_ControlVa(vlc_demux_chained_t *dc, int query, va_list ap)
             break;
         case DEMUX_GET_TIME:
             vlc_mutex_lock(&dc->lock);
-            *va_arg(ap, int64_t *) = dc->stats.time;
+            *va_arg(ap, vlc_tick_t *) = dc->stats.time;
             vlc_mutex_unlock(&dc->lock);
             break;
         default:
diff --git a/src/input/input.c b/src/input/input.c
index 1d6f95c6cb..94a73bad7d 100644
--- a/src/input/input.c
+++ b/src/input/input.c
@@ -2809,7 +2809,7 @@ static void InputSourceMeta( input_thread_t *p_input,
 
 static void SlaveDemux( input_thread_t *p_input )
 {
-    int64_t i_time;
+    vlc_tick_t i_time;
     int i;
 
     if( demux_Control( input_priv(p_input)->master->p_demux, DEMUX_GET_TIME, &i_time ) )
@@ -2831,7 +2831,7 @@ static void SlaveDemux( input_thread_t *p_input )
         {
             for( ;; )
             {
-                int64_t i_stime;
+                vlc_tick_t i_stime;
                 if( demux_Control( in->p_demux, DEMUX_GET_TIME, &i_stime ) )
                 {
                     msg_Err( p_input, "slave[%d] doesn't like "
@@ -2865,7 +2865,7 @@ static void SlaveDemux( input_thread_t *p_input )
 
 static void SlaveSeek( input_thread_t *p_input )
 {
-    int64_t i_time;
+    vlc_tick_t i_time;
     int i;
 
     if( demux_Control( input_priv(p_input)->master->p_demux, DEMUX_GET_TIME, &i_time ) )
@@ -3285,7 +3285,7 @@ static int input_SlaveSourceAdd( input_thread_t *p_input,
     {
         if( b_set_time )
         {
-            int64_t i_time;
+            vlc_tick_t i_time;
 
             /* Set position */
             if( demux_Control( priv->master->p_demux, DEMUX_GET_TIME, &i_time ) )




More information about the vlc-commits mailing list