[vlc-commits] modules: use vlc_tick_from_sec() to convert to ticks instead of CLOCK_FREQ
Steve Lhomme
git at videolan.org
Fri Jul 6 16:07:52 CEST 2018
vlc | branch: master | Steve Lhomme <robux4 at ycbcr.xyz> | Thu Jul 5 14:05:46 2018 +0200| [12b7f43465355ae2063992bd3f6f1fd3e1474185] | committer: Steve Lhomme
modules: use vlc_tick_from_sec() to convert to ticks instead of CLOCK_FREQ
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=12b7f43465355ae2063992bd3f6f1fd3e1474185
---
modules/access/live555.cpp | 2 +-
modules/demux/avformat/demux.c | 6 +++---
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/modules/access/live555.cpp b/modules/access/live555.cpp
index 186505b8aa..62d8142144 100644
--- a/modules/access/live555.cpp
+++ b/modules/access/live555.cpp
@@ -2096,7 +2096,7 @@ static void StreamRead( void *p_private, unsigned int i_size,
if( tk->i_pcr != VLC_TICK_INVALID )
{
tk->i_next_block_flags |= BLOCK_FLAG_DISCONTINUITY;
- const int64_t i_max_diff = CLOCK_FREQ * (( tk->fmt.i_cat == SPU_ES ) ? 60 : 1);
+ const vlc_tick_t i_max_diff = vlc_tick_from_sec(( tk->fmt.i_cat == SPU_ES ) ? 60 : 1);
tk->b_flushing_discontinuity = (llabs(i_pts - tk->i_pcr) > i_max_diff);
tk->i_pcr = i_pts;
}
diff --git a/modules/demux/avformat/demux.c b/modules/demux/avformat/demux.c
index 8f44a00dd1..c88ddfd683 100644
--- a/modules/demux/avformat/demux.c
+++ b/modules/demux/avformat/demux.c
@@ -989,9 +989,9 @@ static block_t *BuildSsaFrame( const AVPacket *p_pkt, unsigned i_order )
block_t *p_frame = block_heap_Alloc( p, strlen(p) + 1 );
if( p_frame )
- p_frame->i_length = CLOCK_FREQ * ((h1-h0) * 3600 +
- (m1-m0) * 60 +
- (s1-s0) * 1) +
+ p_frame->i_length = vlc_tick_from_sec((h1-h0) * 3600 +
+ (m1-m0) * 60 +
+ (s1-s0) * 1) +
CLOCK_FREQ * (c1-c0) / 100;
return p_frame;
}
More information about the vlc-commits
mailing list