[vlc-devel] [PATCH 09/10] demux:mkv: make the default trust level of a Seekpoint to TRUSTED

Steve Lhomme robux4 at videolabs.io
Thu Aug 3 18:18:34 CEST 2017


For a needle it doesn't matter the level, it's never used.
---
 modules/demux/mkv/matroska_segment.cpp        | 11 ++++-------
 modules/demux/mkv/matroska_segment_seeker.cpp |  6 +++---
 modules/demux/mkv/matroska_segment_seeker.hpp |  2 +-
 3 files changed, 8 insertions(+), 11 deletions(-)

diff --git a/modules/demux/mkv/matroska_segment.cpp b/modules/demux/mkv/matroska_segment.cpp
index bffcf0063e..72c2054128 100644
--- a/modules/demux/mkv/matroska_segment.cpp
+++ b/modules/demux/mkv/matroska_segment.cpp
@@ -217,7 +217,7 @@ void matroska_segment_c::LoadCues( KaxCues *cues )
                     }
 
                     _seeker.add_seekpoint( track_id,
-                        SegmentSeeker::Seekpoint(level, cue_position, cue_mk_time) );
+                        SegmentSeeker::Seekpoint( cue_position, cue_mk_time, level ) );
                 }
                 else
                     msg_Warn( &sys.demuxer, "Found cue with invalid track id = %u", track_id );
@@ -639,8 +639,7 @@ bool matroska_segment_c::Preload( )
                  it != tracks.end(); ++it )
             {
                 _seeker.add_seekpoint( it->first,
-                    SegmentSeeker::Seekpoint( SegmentSeeker::Seekpoint::TRUSTED,
-                                              cluster->GetElementPosition(), 0 ) );
+                    SegmentSeeker::Seekpoint( cluster->GetElementPosition(), 0 ) );
             }
 
             ep->Down();
@@ -1209,8 +1208,7 @@ int matroska_segment_c::BlockGet( KaxBlock * & pp_block, KaxSimpleBlock * & pp_s
                 bool const b_valid_track = vars.obj->FindTrackByBlock( NULL, &ksblock ) != NULL;
                 if (b_valid_track)
                     vars.obj->_seeker.add_seekpoint( ksblock.TrackNum(),
-                        SegmentSeeker::Seekpoint( SegmentSeeker::Seekpoint::TRUSTED,
-                                                  ksblock.GetElementPosition(), ksblock.GlobalTimecode() / 1000 ) );
+                        SegmentSeeker::Seekpoint( ksblock.GetElementPosition(), ksblock.GlobalTimecode() / 1000 ) );
             }
         }
     };
@@ -1229,8 +1227,7 @@ int matroska_segment_c::BlockGet( KaxBlock * & pp_block, KaxSimpleBlock * & pp_s
             if( p_track != NULL && p_track->fmt.i_cat == SPU_ES )
             {
                 vars.obj->_seeker.add_seekpoint( kblock.TrackNum(),
-                    SegmentSeeker::Seekpoint( SegmentSeeker::Seekpoint::TRUSTED,
-                                              kblock.GetElementPosition(), kblock.GlobalTimecode() / 1000 ) );
+                    SegmentSeeker::Seekpoint( kblock.GetElementPosition(), kblock.GlobalTimecode() / 1000 ) );
             }
 
             vars.obj->ep->Keep ();
diff --git a/modules/demux/mkv/matroska_segment_seeker.cpp b/modules/demux/mkv/matroska_segment_seeker.cpp
index 186a10bfe5..f55a279fde 100644
--- a/modules/demux/mkv/matroska_segment_seeker.cpp
+++ b/modules/demux/mkv/matroska_segment_seeker.cpp
@@ -159,7 +159,7 @@ SegmentSeeker::get_first_seekpoint_around( mtime_t pts, seekpoints_t const& seek
 
     typedef seekpoints_t::const_iterator iterator;
 
-    Seekpoint const needle ( Seekpoint::DISABLED, std::numeric_limits<fptr_t>::max(), pts );
+    Seekpoint const needle ( std::numeric_limits<fptr_t>::max(), pts );
 
     iterator const it_begin  = seekpoints.begin();
     iterator const it_end    = seekpoints.end();
@@ -186,7 +186,7 @@ SegmentSeeker::get_seekpoints_around( mtime_t pts, seekpoints_t const& seekpoint
 
     typedef seekpoints_t::const_iterator iterator;
 
-    Seekpoint const needle ( Seekpoint::DISABLED, std::numeric_limits<fptr_t>::max(), pts );
+    Seekpoint const needle ( std::numeric_limits<fptr_t>::max(), pts );
 
     iterator const it_begin  = seekpoints.begin();
     iterator const it_end    = seekpoints.end();
@@ -346,7 +346,7 @@ SegmentSeeker::index_unsearched_range( matroska_segment_c& ms, Range search_area
         if( b_valid_track )
         {
             if( b_key_picture )
-                add_seekpoint( track_id, Seekpoint( Seekpoint::TRUSTED, block_pos, block_pts ) );
+                add_seekpoint( track_id, Seekpoint( block_pos, block_pts ) );
 
             if( max_pts < block_pts )
                 break;
diff --git a/modules/demux/mkv/matroska_segment_seeker.hpp b/modules/demux/mkv/matroska_segment_seeker.hpp
index 4e23e93886..a4424576e3 100644
--- a/modules/demux/mkv/matroska_segment_seeker.hpp
+++ b/modules/demux/mkv/matroska_segment_seeker.hpp
@@ -61,7 +61,7 @@ class SegmentSeeker
                 DISABLED = -1,
             };
 
-            Seekpoint( TrustLevel trust_level, fptr_t fpos, mtime_t pts )
+            Seekpoint( fptr_t fpos, mtime_t pts, TrustLevel trust_level = TrustLevel::TRUSTED )
                 : fpos( fpos ), pts( pts ), trust_level( trust_level )
             { }
 
-- 
2.13.0



More information about the vlc-devel mailing list