summaryrefslogtreecommitdiffstats
path: root/demux/demux_mkv.c
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2014-01-22 22:33:55 +0100
committerwm4 <wm4@nowhere>2014-01-22 22:33:55 +0100
commit774eb1d98dce085fa5af52bcd0a1499aecfdca0c (patch)
tree3236ffb3c3fc4b2a9ae330ca545d4046e6478fb3 /demux/demux_mkv.c
parent85bd178dbe95d0970d92c7721a998cee60f14d0b (diff)
downloadmpv-774eb1d98dce085fa5af52bcd0a1499aecfdca0c.tar.bz2
mpv-774eb1d98dce085fa5af52bcd0a1499aecfdca0c.tar.xz
demux_mkv: always fail on header reading error
For some reason, if an error happened when reading headers, it merely stopped reading the headers, and then continued normally. (It looks like the case to exit hard (-2) was mainly used for skipping unwanted ordered chapter segments.) I can't comprehend this. Always exit on error when reading headers. (Maybe some more error tolerance would be good, but I have no test case, and there's some danger of entering endless loops.)
Diffstat (limited to 'demux/demux_mkv.c')
-rw-r--r--demux/demux_mkv.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/demux/demux_mkv.c b/demux/demux_mkv.c
index bec8f871a0..41dc6baed0 100644
--- a/demux/demux_mkv.c
+++ b/demux/demux_mkv.c
@@ -1762,10 +1762,8 @@ static int demux_mkv_open(demuxer_t *demuxer, enum demux_check check)
break;
}
int res = read_header_element(demuxer, id, start_pos);
- if (res <= -2)
- return -1;
if (res < 0)
- break;
+ return -1;
}
// Read headers that come after the first cluster (i.e. require seeking).
@@ -1800,10 +1798,8 @@ static int demux_mkv_open(demuxer_t *demuxer, enum demux_check check)
}
elem->parsed = false; // don't make read_header_element skip it
int res = read_header_element(demuxer, elem->id, elem->pos);
- if (res <= -2)
- return -1;
if (res < 0)
- break;
+ return -1;
}
if (!stream_seek(s, start_pos)) {
MP_ERR(demuxer, "Couldn't seek back after reading headers?\n");