From 7219c0cce6bff1c164b2034b363232cf20273b91 Mon Sep 17 00:00:00 2001 From: Ilkka Ollakka <ileoo@videolan.org> Date: Sun, 9 Aug 2015 19:07:42 +0300 Subject: [PATCH] avformat: use CLOCK_FREQ --- 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 5480af7f201f..8e227a770a42 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 * CLOCK_FREQ + q.rem * 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 * CLOCK_FREQ * + p_stream->time_base.num + q.rem * 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 * CLOCK_FREQ * + p_stream->time_base.num + q.rem * 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; -- GitLab