comparison libmpdemux/demux_mkv.c @ 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 e3f4ad403fff
children a8b42366e68a
comparison
equal deleted inserted replaced
20733:404fb439acba 20734:9f97c2b0340f
1658 * sizeof (off_t)); 1658 * sizeof (off_t));
1659 mkv_d->parsed_seekhead[mkv_d->parsed_seekhead_num++] = off; 1659 mkv_d->parsed_seekhead[mkv_d->parsed_seekhead_num++] = off;
1660 1660
1661 mp_msg(MSGT_DEMUX, MSGL_V, "[mkv] /---- [ parsing seek head ] ---------\n"); 1661 mp_msg(MSGT_DEMUX, MSGL_V, "[mkv] /---- [ parsing seek head ] ---------\n");
1662 length = ebml_read_length (s, NULL); 1662 length = ebml_read_length (s, NULL);
1663 /* off now holds the position of the next element after the seek head. */
1664 off = stream_tell (s) + length;
1663 while (length > 0 && !res) 1665 while (length > 0 && !res)
1664 { 1666 {
1665 1667
1666 seek_id = 0; 1668 seek_id = 0;
1667 seek_pos = EBML_UINT_INVALID; 1669 seek_pos = EBML_UINT_INVALID;
1745 } 1747 }
1746 } 1748 }
1747 1749
1748 stream_seek (s, saved_pos); 1750 stream_seek (s, saved_pos);
1749 } 1751 }
1752 if (res)
1753 {
1754 /* If there was an error then try to skip this seek head. */
1755 if (stream_seek (s, off))
1756 res = 0;
1757 }
1758 else
1750 if (length > 0) 1759 if (length > 0)
1751 stream_seek (s, stream_tell (s) + length); 1760 stream_seek (s, stream_tell (s) + length);
1752 mp_msg(MSGT_DEMUX, MSGL_V, "[mkv] \\---- [ parsing seek head ] ---------\n"); 1761 mp_msg(MSGT_DEMUX, MSGL_V, "[mkv] \\---- [ parsing seek head ] ---------\n");
1753 return res; 1762 return res;
1754 } 1763 }