demux:mkv: do not use invalid seekpoints for the final seek target
authorSteve Lhomme <robUx4@videolabs.io>
Fri, 4 Aug 2017 09:31:43 +0000 (11:31 +0200)
committerJean-Baptiste Kempf <jb@videolan.org>
Fri, 4 Aug 2017 09:57:18 +0000 (11:57 +0200)
Signed-off-by: Jean-Baptiste Kempf <jb@videolan.org>
modules/demux/mkv/matroska_segment_seeker.cpp

index f55a279..75cee3a 100644 (file)
@@ -224,10 +224,12 @@ SegmentSeeker::get_seekpoints_around( mtime_t target_pts, track_ids_t const& pri
                 continue;
             }
 
-            if( points.first.fpos > track_points.first.fpos )
+            if( track_points.first.trust_level > Seekpoint::DISABLED &&
+                points.first.fpos > track_points.first.fpos )
                 points.first = track_points.first;
 
-            if( points.second.fpos < track_points.second.fpos )
+            if( track_points.second.trust_level > Seekpoint::DISABLED &&
+                points.second.fpos < track_points.second.fpos )
                 points.second = track_points.second;
         }
     }