1
0
mirror of https://github.com/mpv-player/mpv synced 2025-01-19 05:41:16 +00:00

demux_mkv: actually skip elements out of reach

This is missing from the previous commit. Not that harmful, but also
slightly un-nice since even a failed seek will reset the cache.
This commit is contained in:
wm4 2015-03-06 20:31:54 +01:00
parent 12dcc5eaac
commit f0ab1f2048

View File

@ -1807,7 +1807,7 @@ static int demux_mkv_open(demuxer_t *demuxer, enum demux_check check)
struct header_elem *elem = &mkv_d->headers[n];
if (elem->parsed)
continue;
// Warn against incomplete files.
// Warn against incomplete files and skip headers outside of range.
if (elem->pos >= end) {
elem->parsed = true; // don't bother if file is incomplete
if (!mkv_d->eof_warning) {
@ -1815,6 +1815,7 @@ static int demux_mkv_open(demuxer_t *demuxer, enum demux_check check)
"end of file - incomplete file?\n");
mkv_d->eof_warning = true;
}
continue;
}
if (elem->id == MATROSKA_ID_CUES) {
// Read cues when they are needed, to avoid seeking on opening.