[vlc-commits] demux:mkv: do not try to use a seekpoint for a track that doesn't exist
Steve Lhomme
git at videolan.org
Wed Aug 2 17:54:54 CEST 2017
vlc | branch: master | Steve Lhomme <robUx4 at videolabs.io> | Wed Aug 2 15:56:04 2017 +0200| [d63fd5e4784ef52d6c8c21b3ca00152824bea23b] | committer: Jean-Baptiste Kempf
demux:mkv: do not try to use a seekpoint for a track that doesn't exist
Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=d63fd5e4784ef52d6c8c21b3ca00152824bea23b
---
modules/demux/mkv/matroska_segment.cpp | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/modules/demux/mkv/matroska_segment.cpp b/modules/demux/mkv/matroska_segment.cpp
index 6baac941c2..24fce246bb 100644
--- a/modules/demux/mkv/matroska_segment.cpp
+++ b/modules/demux/mkv/matroska_segment.cpp
@@ -832,14 +832,18 @@ 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 )
{
+ tracks_map_t::iterator trackit = tracks.find( it->first );
+ if ( trackit == tracks.end() )
+ continue; // there were blocks with unknown tracks
+
if( i_seek_position > it->second.fpos )
{
i_seek_position = it->second.fpos;
i_mk_seek_time = it->second.pts;
}
- tracks.at( it->first )->i_skip_until_fpos = it->second.fpos;
- tracks.at( it->first )->i_last_dts = it->second.pts;
+ trackit->second->i_skip_until_fpos = it->second.fpos;
+ trackit->second->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 );
More information about the vlc-commits
mailing list