vlc | branch: master | Filip Roséen <[email protected]> | Fri May 13 15:34:43 2016 +0200| [38cd4bec5fa18e8b151da96ff5e722c74ffc5944] | committer: Thomas Guillem
mkv: abort seek completely if it fails Signed-off-by: Thomas Guillem <[email protected]> > http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=38cd4bec5fa18e8b151da96ff5e722c74ffc5944 --- modules/demux/mkv/matroska_segment.cpp | 12 +++++++++++- modules/demux/mkv/matroska_segment_seeker.cpp | 3 +-- modules/demux/mkv/mkv.hpp | 1 + 3 files changed, 13 insertions(+), 3 deletions(-) diff --git a/modules/demux/mkv/matroska_segment.cpp b/modules/demux/mkv/matroska_segment.cpp index ac5af66..07c431e 100644 --- a/modules/demux/mkv/matroska_segment.cpp +++ b/modules/demux/mkv/matroska_segment.cpp @@ -807,7 +807,17 @@ void matroska_segment_c::Seek( mtime_t i_absolute_mk_date, mtime_t i_mk_time_off mtime_t i_mk_date = i_absolute_mk_date - i_mk_time_offset; - SegmentSeeker::tracks_seekpoint_t seekpoints = _seeker.get_seekpoints_cues( *this, i_mk_date ); + SegmentSeeker::tracks_seekpoint_t seekpoints; + + try { + seekpoints = _seeker.get_seekpoints_cues( *this, i_mk_date ); + + } + catch( std::exception const& e ) + { + msg_Err( &sys.demuxer, "error during seek: \"%s\", aborting!", e.what() ); + return; + } for( SegmentSeeker::tracks_seekpoint_t::iterator it = seekpoints.begin(); it != seekpoints.end(); ++it ) { diff --git a/modules/demux/mkv/matroska_segment_seeker.cpp b/modules/demux/mkv/matroska_segment_seeker.cpp index 49750a1..8ae1a4a 100644 --- a/modules/demux/mkv/matroska_segment_seeker.cpp +++ b/modules/demux/mkv/matroska_segment_seeker.cpp @@ -283,8 +283,7 @@ SegmentSeeker::index_unsearched_range( matroska_segment_c& ms, Range search_area if( ms.BlockGet( block, simpleblock, &b_key_picture, &b_discardable_picture, &i_block_duration ) ) { - msg_Err( &ms.sys.demuxer, "Unable to BlockGet in matroska_segment_c::Seek, EOF?" ); - return; + throw std::runtime_error( "Unable to BlockGet in SegmentSeeker::index_unsearched_range, EOF?" ); } if( simpleblock ) { diff --git a/modules/demux/mkv/mkv.hpp b/modules/demux/mkv/mkv.hpp index 8bad7dc..6bbca6b 100644 --- a/modules/demux/mkv/mkv.hpp +++ b/modules/demux/mkv/mkv.hpp @@ -53,6 +53,7 @@ #include <vector> #include <algorithm> #include <map> +#include <stdexcept> /* libebml and matroska */ #include "ebml/EbmlHead.h" _______________________________________________ vlc-commits mailing list [email protected] https://mailman.videolan.org/listinfo/vlc-commits
