[vlc-devel] [PATCH 3/5] avformat: use CLOCK_FREQ

Ilkka Ollakka ileoo at videolan.org
Sat Oct 3 14:24:59 CEST 2015


---
 modules/demux/avformat/demux.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/modules/demux/avformat/demux.c b/modules/demux/avformat/demux.c
index 5480af7..3bca509 100644
--- a/modules/demux/avformat/demux.c
+++ b/modules/demux/avformat/demux.c
@@ -739,7 +739,7 @@ static int Demux( demux_t *p_demux )
     if( p_sys->ic->start_time != (int64_t)AV_NOPTS_VALUE )
     {
         q = lldiv( p_sys->ic->start_time, AV_TIME_BASE);
-        i_start_time = q.quot * (int64_t)1000000 + q.rem * (int64_t)1000000 / AV_TIME_BASE;
+        i_start_time = q.quot * (int64_t)CLOCK_FREQ + q.rem * (int64_t)CLOCK_FREQ / AV_TIME_BASE;
     }
     else
         i_start_time = 0;
@@ -749,8 +749,8 @@ static int Demux( demux_t *p_demux )
     else
     {
         q = lldiv( pkt.dts, p_stream->time_base.den );
-        p_frame->i_dts = q.quot * (int64_t)1000000 *
-            p_stream->time_base.num + q.rem * (int64_t)1000000 *
+        p_frame->i_dts = q.quot * (int64_t)CLOCK_FREQ *
+            p_stream->time_base.num + q.rem * (int64_t)CLOCK_FREQ *
             p_stream->time_base.num /
             p_stream->time_base.den - i_start_time + VLC_TS_0;
     }
@@ -760,13 +760,13 @@ static int Demux( demux_t *p_demux )
     else
     {
         q = lldiv( pkt.pts, p_stream->time_base.den );
-        p_frame->i_pts = q.quot * (int64_t)1000000 *
-            p_stream->time_base.num + q.rem * (int64_t)1000000 *
+        p_frame->i_pts = q.quot * (int64_t)CLOCK_FREQ *
+            p_stream->time_base.num + q.rem * (int64_t)CLOCK_FREQ *
             p_stream->time_base.num /
             p_stream->time_base.den - i_start_time + VLC_TS_0;
     }
     if( pkt.duration > 0 && p_frame->i_length <= 0 )
-        p_frame->i_length = pkt.duration * INT64_C(1000000) *
+        p_frame->i_length = pkt.duration * CLOCK_FREQ *
             p_stream->time_base.num /
             p_stream->time_base.den;
 
-- 
2.5.2



More information about the vlc-devel mailing list