[vlc-devel] [PATCH 4/7] demux:mkv: preload Segments from the same family as a Segment with DVD chapter codec

Steve Lhomme robux4 at videolabs.io
Tue Mar 15 08:50:22 CET 2016


---
 modules/demux/mkv/chapter_command.hpp | 3 +++
 modules/demux/mkv/mkv.cpp             | 4 ++++
 2 files changed, 7 insertions(+)

diff --git a/modules/demux/mkv/chapter_command.hpp b/modules/demux/mkv/chapter_command.hpp
index 3969735..bce3835 100644
--- a/modules/demux/mkv/chapter_command.hpp
+++ b/modules/demux/mkv/chapter_command.hpp
@@ -27,6 +27,9 @@
 
 #include "mkv.hpp"
 
+const int MATROSKA_CHAPTER_CODEC_NATIVE  = 0x00;
+const int MATROSKA_CHAPTER_CODEC_DVD     = 0x01;
+
 const binary MATROSKA_DVD_LEVEL_SS   = 0x30;
 const binary MATROSKA_DVD_LEVEL_LU   = 0x2A;
 const binary MATROSKA_DVD_LEVEL_TT   = 0x28;
diff --git a/modules/demux/mkv/mkv.cpp b/modules/demux/mkv/mkv.cpp
index de9bcef..93ad241 100644
--- a/modules/demux/mkv/mkv.cpp
+++ b/modules/demux/mkv/mkv.cpp
@@ -138,6 +138,10 @@ static int Open( vlc_object_t * p_this )
     {
         p_stream->segments[i]->Preload();
         b_need_preload |= p_stream->segments[i]->b_ref_external_segments;
+        if ( p_stream->segments[i]->translations.size() &&
+             p_stream->segments[i]->translations[0]->codec_id == MATROSKA_CHAPTER_CODEC_DVD &&
+             p_stream->segments[i]->families.size() )
+            b_need_preload = true;
     }
 
     p_segment = p_stream->segments[0];
-- 
2.7.2.windows.1



More information about the vlc-devel mailing list