[vlc-commits] demux:mkv: convert libmatroska timestamps using VLC_TICK_FROM_NS()
Steve Lhomme
git at videolan.org
Tue Sep 18 13:52:55 CEST 2018
vlc | branch: master | Steve Lhomme <robux4 at ycbcr.xyz> | Thu Jun 7 16:27:38 2018 +0200| [ae915dcb08efc8fbad2993a03c4a62590e8b8656] | committer: Steve Lhomme
demux:mkv: convert libmatroska timestamps using VLC_TICK_FROM_NS()
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=ae915dcb08efc8fbad2993a03c4a62590e8b8656
---
modules/demux/mkv/matroska_segment.cpp | 4 ++--
modules/demux/mkv/matroska_segment_parse.cpp | 2 +-
modules/demux/mkv/matroska_segment_seeker.cpp | 4 ++--
modules/demux/mkv/mkv.cpp | 2 +-
4 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/modules/demux/mkv/matroska_segment.cpp b/modules/demux/mkv/matroska_segment.cpp
index 4789722d7d..b91d8f5937 100644
--- a/modules/demux/mkv/matroska_segment.cpp
+++ b/modules/demux/mkv/matroska_segment.cpp
@@ -1254,7 +1254,7 @@ int matroska_segment_c::BlockGet( KaxBlock * & pp_block, KaxSimpleBlock * & pp_s
bool const b_valid_track = vars.obj->FindTrackByBlock( NULL, &ksblock ) != NULL;
if (b_valid_track)
vars.obj->_seeker.add_seekpoint( ksblock.TrackNum(),
- SegmentSeeker::Seekpoint( ksblock.GetElementPosition(), ksblock.GlobalTimecode() / 1000 ) );
+ SegmentSeeker::Seekpoint( ksblock.GetElementPosition(), VLC_TICK_FROM_NS(ksblock.GlobalTimecode()) ) );
}
}
};
@@ -1273,7 +1273,7 @@ int matroska_segment_c::BlockGet( KaxBlock * & pp_block, KaxSimpleBlock * & pp_s
if( p_track != NULL && p_track->fmt.i_cat == SPU_ES )
{
vars.obj->_seeker.add_seekpoint( kblock.TrackNum(),
- SegmentSeeker::Seekpoint( kblock.GetElementPosition(), kblock.GlobalTimecode() / 1000 ) );
+ SegmentSeeker::Seekpoint( kblock.GetElementPosition(), VLC_TICK_FROM_NS(kblock.GlobalTimecode()) ) );
}
vars.ep->Keep ();
diff --git a/modules/demux/mkv/matroska_segment_parse.cpp b/modules/demux/mkv/matroska_segment_parse.cpp
index 373296a0e1..1d2c45d41f 100644
--- a/modules/demux/mkv/matroska_segment_parse.cpp
+++ b/modules/demux/mkv/matroska_segment_parse.cpp
@@ -1477,7 +1477,7 @@ bool matroska_segment_c::ParseCluster( KaxCluster *cluster, bool b_update_start_
}
if( b_update_start_time )
- i_mk_start_time = cluster->GlobalTimecode() / INT64_C( 1000 );
+ i_mk_start_time = VLC_TICK_FROM_NS( cluster->GlobalTimecode() );
return true;
}
diff --git a/modules/demux/mkv/matroska_segment_seeker.cpp b/modules/demux/mkv/matroska_segment_seeker.cpp
index 2c17b60328..5710f3b917 100644
--- a/modules/demux/mkv/matroska_segment_seeker.cpp
+++ b/modules/demux/mkv/matroska_segment_seeker.cpp
@@ -68,7 +68,7 @@ SegmentSeeker::add_cluster( KaxCluster * const p_cluster )
{
Cluster cinfo = {
/* fpos */ p_cluster->GetElementPosition(),
- /* pts */ vlc_tick_t( p_cluster->GlobalTimecode() / INT64_C( 1000 ) ),
+ /* pts */ VLC_TICK_FROM_NS( p_cluster->GlobalTimecode() ),
/* duration */ vlc_tick_t( -1 ),
/* size */ p_cluster->IsFiniteSize()
? p_cluster->GetEndPosition() - p_cluster->GetElementPosition()
@@ -364,7 +364,7 @@ SegmentSeeker::index_unsearched_range( matroska_segment_c& ms, Range search_area
: static_cast<KaxInternalBlock&>( *block );
block_pos = internal_block.GetElementPosition();
- block_pts = internal_block.GlobalTimecode() / 1000;
+ block_pts = VLC_TICK_FROM_NS(internal_block.GlobalTimecode());
track_id = internal_block.TrackNum();
bool const b_valid_track = ms.FindTrackByBlock( block, simpleblock ) != NULL;
diff --git a/modules/demux/mkv/mkv.cpp b/modules/demux/mkv/mkv.cpp
index 07a8cb39c7..6dffee95a2 100644
--- a/modules/demux/mkv/mkv.cpp
+++ b/modules/demux/mkv/mkv.cpp
@@ -816,7 +816,7 @@ static int Demux( demux_t *p_demux)
/* set pts */
{
p_sys->i_pts = p_sys->i_mk_chapter_time + VLC_TICK_0;
- p_sys->i_pts += internal_block.GlobalTimecode() / INT64_C( 1000 );
+ p_sys->i_pts += VLC_TICK_FROM_NS(internal_block.GlobalTimecode());
}
if ( p_vsegment->CurrentEdition() &&
More information about the vlc-commits
mailing list