[vlc-commits] demux: mkv: constify iterators

Tristan Matthews git at videolan.org
Thu Jul 14 00:18:37 CEST 2016


vlc | branch: master | Tristan Matthews <tmatth at videolan.org> | Wed Jul 13 18:03:55 2016 -0400| [c19b716b8aed38c30ba830e824f746e31ca1373f] | committer: Tristan Matthews

demux: mkv: constify iterators

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

 modules/demux/mkv/matroska_segment.cpp |   10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/modules/demux/mkv/matroska_segment.cpp b/modules/demux/mkv/matroska_segment.cpp
index 2160fb5..f7209fc 100644
--- a/modules/demux/mkv/matroska_segment.cpp
+++ b/modules/demux/mkv/matroska_segment.cpp
@@ -639,7 +639,8 @@ bool matroska_segment_c::Preload( )
             IndexAppendCluster( cluster );
 
             // add first cluster as trusted seekpoint for all tracks
-            for( tracks_map_t::iterator it = tracks.begin(); it != tracks.end(); ++it )
+            for( tracks_map_t::const_iterator it = tracks.begin();
+                 it != tracks.end(); ++it )
             {
                 _seeker.add_seekpoint( it->first, SegmentSeeker::Seekpoint::TRUSTED,
                   cluster->GetElementPosition(), 0 );
@@ -828,7 +829,7 @@ void matroska_segment_c::Seek( mtime_t i_absolute_mk_date, mtime_t i_mk_time_off
 
     // initialize seek information in order to set up playback //
 
-    for( SegmentSeeker::tracks_seekpoint_t::iterator it = seekpoints.begin(); it != seekpoints.end(); ++it )
+    for( SegmentSeeker::tracks_seekpoint_t::const_iterator it = seekpoints.begin(); it != seekpoints.end(); ++it )
     {
         mkv_track_t& track = tracks[ it->first ];
 
@@ -889,9 +890,10 @@ void matroska_segment_c::ComputeTrackPriority()
     bool b_has_default_video = false;
     bool b_has_default_audio = false;
     /* check for default */
-    for( tracks_map_t::iterator it = tracks.begin(); it != tracks.end(); ++it )
+    for( tracks_map_t::const_iterator it = tracks.begin(); it != tracks.end();
+         ++it )
     {
-        tracks_map_t::mapped_type& track = it->second;
+        const tracks_map_t::mapped_type& track = it->second;
 
         bool flag = track.b_enabled && ( track.b_default || track.b_forced );
 



More information about the vlc-commits mailing list