[vlc-commits] mkv: removed matroska_segment_c::i_cluster_pos

Filip Roséen git at videolan.org
Mon May 9 15:09:31 CEST 2016


vlc | branch: master | Filip Roséen <filip at videolabs.io> | Mon May  9 14:53:19 2016 +0200| [d59f710f197558b05b47127872a8915a37179ffe] | committer: Jean-Baptiste Kempf

mkv: removed matroska_segment_c::i_cluster_pos

This data-member serves no real purpose now that we do not require
EbmlParser::UnGet.

Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>

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

 modules/demux/mkv/matroska_segment.cpp        |    3 ---
 modules/demux/mkv/matroska_segment.hpp        |    1 -
 modules/demux/mkv/matroska_segment_seeker.cpp |   14 +++++++-------
 3 files changed, 7 insertions(+), 11 deletions(-)

diff --git a/modules/demux/mkv/matroska_segment.cpp b/modules/demux/mkv/matroska_segment.cpp
index dd2289f..743a5f4 100644
--- a/modules/demux/mkv/matroska_segment.cpp
+++ b/modules/demux/mkv/matroska_segment.cpp
@@ -46,7 +46,6 @@ matroska_segment_c::matroska_segment_c( demux_sys_t & demuxer, EbmlStream & estr
     ,i_attachments_position(-1)
     ,cluster(NULL)
     ,i_block_pos(0)
-    ,i_cluster_pos(0)
     ,p_segment_uid(NULL)
     ,p_prev_segment_uid(NULL)
     ,p_next_segment_uid(NULL)
@@ -635,7 +634,6 @@ bool matroska_segment_c::Preload( )
 
             cluster = kc_ptr;
 
-            i_cluster_pos = cluster->GetElementPosition();
             ParseCluster( cluster );
             IndexAppendCluster( cluster );
 
@@ -1102,7 +1100,6 @@ int matroska_segment_c::BlockGet( KaxBlock * & pp_block, KaxSimpleBlock * & pp_s
         E_CASE( KaxCluster, kcluster )
         {
             vars.obj->cluster = &kcluster;
-            vars.obj->i_cluster_pos = vars.obj->cluster->GetElementPosition();
 
             vars.ep->Down ();
         }
diff --git a/modules/demux/mkv/matroska_segment.hpp b/modules/demux/mkv/matroska_segment.hpp
index 4ee159a..c39c275 100644
--- a/modules/demux/mkv/matroska_segment.hpp
+++ b/modules/demux/mkv/matroska_segment.hpp
@@ -105,7 +105,6 @@ public:
 
     KaxCluster              *cluster;
     uint64                  i_block_pos;
-    uint64                  i_cluster_pos;
     KaxSegmentUID           *p_segment_uid;
     KaxPrevUID              *p_prev_segment_uid;
     KaxNextUID              *p_next_segment_uid;
diff --git a/modules/demux/mkv/matroska_segment_seeker.cpp b/modules/demux/mkv/matroska_segment_seeker.cpp
index c545053..9bc694a 100644
--- a/modules/demux/mkv/matroska_segment_seeker.cpp
+++ b/modules/demux/mkv/matroska_segment_seeker.cpp
@@ -380,8 +380,8 @@ SegmentSeeker::get_search_areas( fptr_t start, fptr_t end ) const
 void
 SegmentSeeker::mkv_jump_to( matroska_segment_c& ms, fptr_t fpos )
 {
-    ms.cluster       = NULL;
-    ms.i_cluster_pos =   -1;
+    fptr_t i_cluster_pos = -1;
+    ms.cluster = NULL;
 
     {
         cluster_positions_t::iterator cluster_it = greatest_lower_bound(
@@ -394,12 +394,12 @@ SegmentSeeker::mkv_jump_to( matroska_segment_c& ms, fptr_t fpos )
 
     while( ms.cluster == NULL || ms.cluster->GetEndPosition() < fpos )
     {
-        ms.cluster       = static_cast<KaxCluster*>( ms.ep->Get() );
-        ms.i_cluster_pos = ms.cluster->GetElementPosition();
+        ms.cluster    = static_cast<KaxCluster*>( ms.ep->Get() );
+        i_cluster_pos = ms.cluster->GetElementPosition();
 
-        add_cluster_position( ms.i_cluster_pos );
+        add_cluster_position( i_cluster_pos );
 
-        mark_range_as_searched( Range( ms.i_cluster_pos, ms.es.I_O().getFilePointer() ) );
+        mark_range_as_searched( Range( i_cluster_pos, ms.es.I_O().getFilePointer() ) );
     }
 
     ms.ep->Down();
@@ -418,7 +418,7 @@ SegmentSeeker::mkv_jump_to( matroska_segment_c& ms, fptr_t fpos )
 
     /* TODO: add error handling; what if we never get a KaxCluster and/or KaxClusterTimecode? */
 
-    mark_range_as_searched( Range( ms.i_cluster_pos, ms.es.I_O().getFilePointer() ) );
+    mark_range_as_searched( Range( i_cluster_pos, ms.es.I_O().getFilePointer() ) );
 
     /* jump to desired position */
 



More information about the vlc-commits mailing list