[vlc-devel] [PATCH 10/11] mkv: implemented (and enabled) matroska_segment_c::FastSeek

Filip Roséen filip at videolabs.io
Sat May 21 02:18:02 CEST 2016


The logic for precise and inprecise seeking is the same with the
addition that precise seeking should use the exact desired timestamp
to use with ES_OUT_SET_NEXT_DISPLAY_TIME, whereas inprecise seeking will
use the timestamp associated with the closest index frame.
---
 modules/demux/mkv/matroska_segment.cpp | 6 +++---
 modules/demux/mkv/virtual_segment.cpp  | 5 -----
 2 files changed, 3 insertions(+), 8 deletions(-)

diff --git a/modules/demux/mkv/matroska_segment.cpp b/modules/demux/mkv/matroska_segment.cpp
index 9167073..e3773b0 100644
--- a/modules/demux/mkv/matroska_segment.cpp
+++ b/modules/demux/mkv/matroska_segment.cpp
@@ -795,10 +795,10 @@ bool matroska_segment_c::LoadSeekHeadItem( const EbmlCallbacks & ClassInfos, int
 
 void matroska_segment_c::FastSeek( mtime_t i_mk_date, mtime_t i_mk_time_offset )
 {
-    VLC_UNUSED( i_mk_date );
-    VLC_UNUSED( i_mk_time_offset );
+    Seek( i_mk_date, i_mk_time_offset );
 
-    msg_Err( &sys.demuxer, "%s is not implemented in this patch", __func__ );
+    sys.i_start_pts = sys.i_pts;
+    es_out_Control( sys.demuxer.out, ES_OUT_SET_NEXT_DISPLAY_TIME, sys.i_start_pts );
 }
 
 void matroska_segment_c::Seek( mtime_t i_absolute_mk_date, mtime_t i_mk_time_offset )
diff --git a/modules/demux/mkv/virtual_segment.cpp b/modules/demux/mkv/virtual_segment.cpp
index f7a5304..5d30d7e 100644
--- a/modules/demux/mkv/virtual_segment.cpp
+++ b/modules/demux/mkv/virtual_segment.cpp
@@ -541,13 +541,8 @@ void virtual_segment_c::Seek( demux_t & demuxer, mtime_t i_mk_date,
 
             seek_callback_t pf_seek = &matroska_segment_c::Seek;
 
-#if 0
-            /* disabled due to non-existing implementation */
             if( ! b_precise )
                 pf_seek = &matroska_segment_c::FastSeek;
-#else
-            VLC_UNUSED( b_precise );
-#endif
 
             p_current_vchapter = p_vchapter;
 
-- 
2.8.2



More information about the vlc-devel mailing list