[vlc-devel] [PATCH 2/2] demux:mkv: always start from the first Cluster when we don't know we to seek

Steve Lhomme robux4 at videolabs.io
Fri Feb 2 17:02:06 CET 2018


When the file is truncated some previous seek may have failed and we need to
reset the OEF.
---
 modules/demux/mkv/matroska_segment_seeker.cpp | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/modules/demux/mkv/matroska_segment_seeker.cpp b/modules/demux/mkv/matroska_segment_seeker.cpp
index e6f8a5b13d..bb38ee31de 100644
--- a/modules/demux/mkv/matroska_segment_seeker.cpp
+++ b/modules/demux/mkv/matroska_segment_seeker.cpp
@@ -486,6 +486,11 @@ SegmentSeeker::mkv_jump_to( matroska_segment_c& ms, fptr_t fpos )
             mark_range_as_searched( Range( i_cluster_pos, ms.es.I_O().getFilePointer() ) );
         }
     }
+    else if (ms.cluster != NULL)
+    {
+        // make sure we start reading after the Cluster start
+        ms.es.I_O().setFilePointer(ms.cluster->GetDataStart());
+    }
 
     ms.ep.Down();
 
-- 
2.14.2



More information about the vlc-devel mailing list