[vlc-commits] demux:mkv: remove some redundant cluster indexing calls

Steve Lhomme git at videolan.org
Wed Jan 24 08:51:09 CET 2018


vlc/vlc-3.0 | branch: master | Steve Lhomme <robux4 at ycbcr.xyz> | Tue Jan 23 11:03:48 2018 +0100| [68fdd18d3da06442a70f7039315ac8768b71caf2] | committer: Jean-Baptiste Kempf

demux:mkv: remove some redundant cluster indexing calls

We always add it to the index as soon as we have its timecode.

(cherry picked from commit 7e8a3b48e9a54c9a25d056aaac08dbf1b72c5810)
Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>

> http://git.videolan.org/gitweb.cgi/vlc/vlc-3.0.git/?a=commit;h=68fdd18d3da06442a70f7039315ac8768b71caf2
---

 modules/demux/mkv/matroska_segment.cpp | 10 ++--------
 modules/demux/mkv/matroska_segment.hpp |  1 -
 2 files changed, 2 insertions(+), 9 deletions(-)

diff --git a/modules/demux/mkv/matroska_segment.cpp b/modules/demux/mkv/matroska_segment.cpp
index bd2fd7e7be..70579ccd1d 100644
--- a/modules/demux/mkv/matroska_segment.cpp
+++ b/modules/demux/mkv/matroska_segment.cpp
@@ -469,11 +469,6 @@ void matroska_segment_c::InformationCreate( )
  * Misc
  *****************************************************************************/
 
-void matroska_segment_c::IndexAppendCluster( KaxCluster *cluster )
-{
-    _seeker.add_cluster( cluster );
-}
-
 bool matroska_segment_c::PreloadClusters(uint64 i_cluster_pos)
 {
     struct ClusterHandlerPayload
@@ -489,8 +484,7 @@ bool matroska_segment_c::PreloadClusters(uint64 i_cluster_pos)
 
         E_CASE( KaxCluster, kcluster )
         {
-            if( vars.obj->ParseCluster( &kcluster, false ) )
-                vars.obj->IndexAppendCluster( &kcluster );
+            vars.obj->ParseCluster( &kcluster, false );
         }
 
         E_CASE_DEFAULT( el )
@@ -1206,7 +1200,7 @@ int matroska_segment_c::BlockGet( KaxBlock * & pp_block, KaxSimpleBlock * & pp_s
         {
             ktimecode.ReadData( vars.obj->es.I_O(), SCOPE_ALL_DATA );
             vars.obj->cluster->InitTimecode( static_cast<uint64>( ktimecode ), vars.obj->i_timescale );
-            vars.obj->IndexAppendCluster( vars.obj->cluster );
+            vars.obj->_seeker.add_cluster( vars.obj->cluster );
             vars.b_cluster_timecode = true;
         }
         E_CASE( KaxClusterSilentTracks, ksilent )
diff --git a/modules/demux/mkv/matroska_segment.hpp b/modules/demux/mkv/matroska_segment.hpp
index f2c9d3966c..8a0ac57c0d 100644
--- a/modules/demux/mkv/matroska_segment.hpp
+++ b/modules/demux/mkv/matroska_segment.hpp
@@ -166,7 +166,6 @@ private:
     void ParseTrackEntry( const KaxTrackEntry* m );
     bool ParseCluster( KaxCluster *cluster, bool b_update_start_time = true, ScopeMode read_fully = SCOPE_ALL_DATA );
     bool ParseSimpleTags( SimpleTag* out, KaxTagSimple *tag, int level = 50 );
-    void IndexAppendCluster( KaxCluster *cluster );
     bool TrackInit( mkv_track_t * p_tk );
     void ComputeTrackPriority();
     void EnsureDuration();



More information about the vlc-commits mailing list