[vlc-commits] demux:mkv: use at() instead of array index
Steve Lhomme
git at videolan.org
Thu Jul 13 11:10:04 CEST 2017
vlc | branch: master | Steve Lhomme <robux4 at videolabs.io> | Wed Jul 12 15:10:13 2017 +0200| [913e642c75e8bd9c2ec9486c2f017ddfe8b96e76] | committer: Jean-Baptiste Kempf
demux:mkv: use at() instead of array index
The latter seems to do a copy (needs an empty constructor).
Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=913e642c75e8bd9c2ec9486c2f017ddfe8b96e76
---
modules/demux/mkv/matroska_segment.cpp | 8 +++-----
1 file changed, 3 insertions(+), 5 deletions(-)
diff --git a/modules/demux/mkv/matroska_segment.cpp b/modules/demux/mkv/matroska_segment.cpp
index 5bcc3b51a6..a271d94a46 100644
--- a/modules/demux/mkv/matroska_segment.cpp
+++ b/modules/demux/mkv/matroska_segment.cpp
@@ -842,16 +842,14 @@ bool matroska_segment_c::Seek( mtime_t i_absolute_mk_date, mtime_t i_mk_time_off
for( SegmentSeeker::tracks_seekpoint_t::const_iterator it = seekpoints.begin(); it != seekpoints.end(); ++it )
{
- mkv_track_t& track = tracks[ it->first ];
-
if( i_seek_position > it->second.fpos )
{
i_seek_position = it->second.fpos;
i_mk_seek_time = it->second.pts;
}
- track.i_skip_until_fpos = it->second.fpos;
- track.i_last_dts = it->second.pts;
+ tracks.at( it->first ).i_skip_until_fpos = it->second.fpos;
+ tracks.at( it->first ).i_last_dts = it->second.pts;
msg_Dbg( &sys.demuxer, "seek: preroll{ track: %u, pts: %" PRId64 ", fpos: %" PRIu64 " } ",
it->first, it->second.pts, it->second.fpos );
@@ -1230,7 +1228,7 @@ int matroska_segment_c::BlockGet( KaxBlock * & pp_block, KaxSimpleBlock * & pp_s
vars.block->ReadData( vars.obj->es.I_O() );
vars.block->SetParent( *vars.obj->cluster );
- if( vars.obj->tracks[ kblock.TrackNum() ].fmt.i_cat == SPU_ES )
+ if( vars.obj->tracks.at( kblock.TrackNum() ).fmt.i_cat == SPU_ES )
{
vars.obj->_seeker.add_seekpoint( kblock.TrackNum(), SegmentSeeker::Seekpoint::TRUSTED, kblock.GetElementPosition(), kblock.GlobalTimecode() / 1000 );
}
More information about the vlc-commits
mailing list