From 9c4d0280849acb2973f5abcc4511b6cdd28fe6ca Mon Sep 17 00:00:00 2001 From: mosu Date: Tue, 7 Nov 2006 18:14:30 +0000 Subject: [PATCH] If parsing a seek head fails then mplayer should try continue parsing the file after the seek head. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@20750 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libmpdemux/demux_mkv.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/libmpdemux/demux_mkv.c b/libmpdemux/demux_mkv.c index 0b28536bc4..0efd3ab6e2 100644 --- a/libmpdemux/demux_mkv.c +++ b/libmpdemux/demux_mkv.c @@ -1660,6 +1660,8 @@ demux_mkv_read_seekhead (demuxer_t *demuxer) mp_msg(MSGT_DEMUX, MSGL_V, "[mkv] /---- [ parsing seek head ] ---------\n"); length = ebml_read_length (s, NULL); + /* off now holds the position of the next element after the seek head. */ + off = stream_tell (s) + length; while (length > 0 && !res) { @@ -1747,6 +1749,13 @@ demux_mkv_read_seekhead (demuxer_t *demuxer) stream_seek (s, saved_pos); } + if (res) + { + /* If there was an error then try to skip this seek head. */ + if (stream_seek (s, off)) + res = 0; + } + else if (length > 0) stream_seek (s, stream_tell (s) + length); mp_msg(MSGT_DEMUX, MSGL_V, "[mkv] \\---- [ parsing seek head ] ---------\n");