changeset 20734:9f97c2b0340f

If parsing a seek head fails then mplayer should try continue parsing the file after the seek head.
author mosu
date Tue, 07 Nov 2006 18:14:30 +0000
parents 404fb439acba
children 4c49ff8992e9
files libmpdemux/demux_mkv.c
diffstat 1 files changed, 9 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/libmpdemux/demux_mkv.c	Tue Nov 07 17:37:23 2006 +0000
+++ b/libmpdemux/demux_mkv.c	Tue Nov 07 18:14:30 2006 +0000
@@ -1660,6 +1660,8 @@
 
   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 @@
 
       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");