[vlc-commits] mkv: fix playback/seek for files where first block has PTS > 0

Filip Roséen git at videolan.org
Thu May 26 13:59:58 CEST 2016


vlc | branch: master | Filip Roséen <filip at videolabs.io> | Thu May 26 13:35:55 2016 +0200| [a254112b5abaa27282e998f822993db731aa9649] | committer: 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
location).

Signed-off-by: Thomas Guillem <thomas at gllm.fr>

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=a254112b5abaa27282e998f822993db731aa9649
---

 modules/demux/mkv/matroska_segment.cpp |    8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/modules/demux/mkv/matroska_segment.cpp b/modules/demux/mkv/matroska_segment.cpp
index 4f57957..18fdb8b 100644
--- a/modules/demux/mkv/matroska_segment.cpp
+++ b/modules/demux/mkv/matroska_segment.cpp
@@ -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 )
             {
-                _seeker.add_seekpoint(
-                  it->first,
-                  SegmentSeeker::Seekpoint::TRUSTED,
-                  cluster->GetElementPosition(),
-                  cluster->GlobalTimecode() / 1000
-                );
+                _seeker.add_seekpoint( it->first, SegmentSeeker::Seekpoint::TRUSTED,
+                  cluster->GetElementPosition(), 0 );
             }
 
             ep->Down();



More information about the vlc-commits mailing list