[vlc-commits] demux:mkv: do not find seek point when we don't have an end boundary

Steve Lhomme git at videolan.org
Fri Jan 19 09:28:55 CET 2018


vlc | branch: master | Steve Lhomme <robux4 at ycbcr.xyz> | Fri Jan 19 09:28:43 2018 +0100| [cadcd7a9842a0b2439d24999b53cd75f53328dcf] | committer: Steve Lhomme

demux:mkv: do not find seek point when we don't have an end boundary

We'll just use the seekpoints we already have.

Fixes #17576

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

 modules/demux/mkv/matroska_segment_seeker.cpp | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/modules/demux/mkv/matroska_segment_seeker.cpp b/modules/demux/mkv/matroska_segment_seeker.cpp
index ab85bbf8fc..0e83e4e2c5 100644
--- a/modules/demux/mkv/matroska_segment_seeker.cpp
+++ b/modules/demux/mkv/matroska_segment_seeker.cpp
@@ -290,17 +290,17 @@ SegmentSeeker::get_seekpoints( matroska_segment_c& ms, mtime_t target_pts,
         Seekpoint const& start = seekpoints.first;
         Seekpoint const& end   = seekpoints.second;
 
-        if (start.fpos == std::numeric_limits<fptr_t>::max() )
+        if ( start.fpos == std::numeric_limits<fptr_t>::max() )
             return tracks_seekpoint_t();
 
-        index_range( ms, Range( start.fpos, end.fpos ), needle_pts );
+        if ( end.fpos != std::numeric_limits<fptr_t>::max() )
+            // do not read the whole (infinite?) file to get seek indexes
+            index_range( ms, Range( start.fpos, end.fpos ), needle_pts );
 
-        {
-            tracks_seekpoint_t tpoints = find_greatest_seekpoints_in_range( start.fpos, target_pts, filter_tracks );
+        tracks_seekpoint_t tpoints = find_greatest_seekpoints_in_range( start.fpos, target_pts, filter_tracks );
 
-            if( contains_all_of_t() ( tpoints, priority_tracks ) )
-                return tpoints;
-        }
+        if( contains_all_of_t() ( tpoints, priority_tracks ) )
+            return tpoints;
 
         needle_pts = start.pts - 1;
     }



More information about the vlc-commits mailing list