[vlc-devel] [PATCH 5/9] mkv: allow preparing playback for a different timestamp than 0

Steve Lhomme robux4 at videolabs.io
Thu Mar 17 16:53:04 CET 2016


---
 modules/demux/mkv/demux.cpp | 8 ++++----
 modules/demux/mkv/demux.hpp | 2 +-
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/modules/demux/mkv/demux.cpp b/modules/demux/mkv/demux.cpp
index ac50dd4..21ab2f4 100644
--- a/modules/demux/mkv/demux.cpp
+++ b/modules/demux/mkv/demux.cpp
@@ -776,7 +776,7 @@ void demux_sys_t::FreeUnused()
     }
 }
 
-bool demux_sys_t::PreparePlayback( virtual_segment_c *p_new_vsegment )
+bool demux_sys_t::PreparePlayback( virtual_segment_c *p_new_vsegment, mtime_t i_mk_date )
 {
     if ( p_new_vsegment != NULL && p_new_vsegment != p_current_vsegment )
     {
@@ -795,11 +795,11 @@ bool demux_sys_t::PreparePlayback( virtual_segment_c *p_new_vsegment )
 
     /* add information */
     p_current_vsegment->CurrentSegment()->InformationCreate( );
-    p_current_vsegment->CurrentSegment()->Select( 0 );
+    p_current_vsegment->CurrentSegment()->Select( i_mk_date );
 
     /* Seek to the beginning */
     p_current_vsegment->Seek(p_current_vsegment->CurrentSegment()->sys.demuxer,
-                            0, NULL, -1);
+                            i_mk_date, NULL, -1);
 
     return true;
 }
@@ -809,7 +809,7 @@ void demux_sys_t::JumpTo( virtual_segment_c & vsegment, virtual_chapter_c & vcha
     // if the segment is not part of the current segment, select the new one
     if ( &vsegment != p_current_vsegment )
     {
-        PreparePlayback( &vsegment );
+        PreparePlayback( &vsegment, vchapter.i_mk_virtual_start_time );
     }
 
     if ( !vchapter.p_chapter || !vchapter.p_chapter->Enter( true ) )
diff --git a/modules/demux/mkv/demux.hpp b/modules/demux/mkv/demux.hpp
index 519e85b..dd7c86e 100644
--- a/modules/demux/mkv/demux.hpp
+++ b/modules/demux/mkv/demux.hpp
@@ -383,7 +383,7 @@ public:
     void PreloadFamily( const matroska_segment_c & of_segment );
     bool PreloadLinked();
     void FreeUnused();
-    bool PreparePlayback( virtual_segment_c *p_new_vsegment );
+    bool PreparePlayback( virtual_segment_c *p_new_vsegment, mtime_t i_mk_date = 0 );
     matroska_stream_c *AnalyseAllSegmentsFound( demux_t *p_demux, EbmlStream *p_estream, bool b_initial = false );
     void JumpTo( virtual_segment_c & vsegment, virtual_chapter_c & vchapter );
 
-- 
2.7.1



More information about the vlc-devel mailing list