demux:mkv: make the default trust level of a Seekpoint to TRUSTED
authorSteve Lhomme <robUx4@videolabs.io>
Thu, 3 Aug 2017 16:18:34 +0000 (18:18 +0200)
committerJean-Baptiste Kempf <jb@videolan.org>
Fri, 4 Aug 2017 07:56:20 +0000 (09:56 +0200)
For a needle it doesn't matter the level, it's never used.

Signed-off-by: Jean-Baptiste Kempf <jb@videolan.org>
modules/demux/mkv/matroska_segment.cpp
modules/demux/mkv/matroska_segment_seeker.cpp
modules/demux/mkv/matroska_segment_seeker.hpp

index bffcf00..72c2054 100644 (file)
@@ -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 ();
index 186a10b..f55a279 100644 (file)
@@ -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;
index 4e23e93..a442457 100644 (file)
@@ -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 )
             { }