[vlc-devel] [PATCH] MKV: avoid recursive parsing of the same Seek head

Steve Lhomme robUx4 at videolabs.io
Fri Feb 27 15:43:56 CET 2015


---
 modules/demux/mkv/matroska_segment.cpp | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/modules/demux/mkv/matroska_segment.cpp b/modules/demux/mkv/matroska_segment.cpp
index 3f12c0e..f09984b 100644
--- a/modules/demux/mkv/matroska_segment.cpp
+++ b/modules/demux/mkv/matroska_segment.cpp
@@ -770,8 +770,11 @@ bool matroska_segment_c::LoadSeekHeadItem( const EbmlCallbacks & ClassInfos, int
         msg_Dbg( &sys.demuxer, "|   + Seek head" );
         if( i_seekhead_count < 10 )
         {
-            i_seekhead_position = i_element_position;
-            ParseSeekHead( static_cast<KaxSeekHead*>( el ) );
+            if ( i_seekhead_position != i_element_position )
+            {
+                i_seekhead_position = i_element_position;
+                ParseSeekHead( static_cast<KaxSeekHead*>( el ) );
+            }
         }
     }
     else if( MKV_IS_ID( el, KaxInfo ) ) // FIXME
-- 
2.2.2




More information about the vlc-devel mailing list