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:
parent
12dcc5eaac
commit
f0ab1f2048
@ -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.
|
||||
|
Loading…
Reference in New Issue
Block a user