Commit a254112b authored by Filip Roséen's avatar Filip Roséen Committed by Thomas Guillem

mkv: fix playback/seek for files where first block has PTS > 0

Some files do not have their first cluster at PTS=0, meaning that we
might spend an eternity looking for such PTS (even though it is not at
all present in the file) when starting playback (seeking to 0).

This patch fixes the issue by always assigning a seekpoint for PTS=0 pointing
at the first cluster position. Instead of using the cluster-timecode, a
hardcoded value of 0 is used (so that every file will have a seekpoint at that
Signed-off-by: Thomas Guillem's avatarThomas Guillem <>
parent 106205be
......@@ -641,12 +641,8 @@ bool matroska_segment_c::Preload( )
// add first cluster as trusted seekpoint for all tracks
for( tracks_map_t::iterator it = tracks.begin(); it != tracks.end(); ++it )
cluster->GlobalTimecode() / 1000
_seeker.add_seekpoint( it->first, SegmentSeeker::Seekpoint::TRUSTED,
cluster->GetElementPosition(), 0 );
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment