[vlc-commits] modules: convert microseconds to ticks using VLC_TICK_FROM_US()

Steve Lhomme git at videolan.org
Tue Jul 3 15:30:49 CEST 2018


vlc | branch: master | Steve Lhomme <robux4 at ycbcr.xyz> | Tue Jul  3 15:09:58 2018 +0200| [bdcbc671cc73924094a1e9f740186c577e7c8e70] | committer: Steve Lhomme

modules: convert microseconds to ticks using VLC_TICK_FROM_US()

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

 modules/access/live555.cpp  | 2 +-
 modules/access/v4l2/video.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/modules/access/live555.cpp b/modules/access/live555.cpp
index b20db653ec..281687ee1b 100644
--- a/modules/access/live555.cpp
+++ b/modules/access/live555.cpp
@@ -1933,7 +1933,7 @@ static void StreamRead( void *p_private, unsigned int i_size,
     //msg_Dbg( p_demux, "pts: %d", pts.tv_sec );
 
     vlc_tick_t i_pts = vlc_tick_from_sec( pts.tv_sec ) +
-        (int64_t)pts.tv_usec;
+        VLC_TICK_FROM_US( pts.tv_usec );
 
     /* XXX Beurk beurk beurk Avoid having negative value XXX */
     i_pts &= INT64_C(0x00ffffffffffffff);
diff --git a/modules/access/v4l2/video.c b/modules/access/v4l2/video.c
index 9a08aeb3c2..d757111d56 100644
--- a/modules/access/v4l2/video.c
+++ b/modules/access/v4l2/video.c
@@ -568,7 +568,7 @@ vlc_tick_t GetBufferPTS (const struct v4l2_buffer *buf)
     {
         case V4L2_BUF_FLAG_TIMESTAMP_MONOTONIC:
             pts = vlc_tick_from_sec( buf->timestamp.tv_sec )
-                 + buf->timestamp.tv_usec;
+                 + VLC_TICK_FROM_US( buf->timestamp.tv_usec );
             static_assert (CLOCK_FREQ == 1000000, "Clock unit mismatch");
             break;
         case V4L2_BUF_FLAG_TIMESTAMP_UNKNOWN:



More information about the vlc-commits mailing list