diff options
author | Uoti Urpala <uau@glyph.nonexistent.invalid> | 2010-01-25 02:43:27 +0200 |
---|---|---|
committer | Uoti Urpala <uau@glyph.nonexistent.invalid> | 2010-01-27 14:26:48 +0200 |
commit | 8b0726b28a3d633a89dc660f2563266a0dcca69b (patch) | |
tree | c0dc6e285ae2d158957170ff37a1f819e6eb5c86 /libmpdemux/ebml.c | |
parent | 5f631d1c0834927a945d72dc8e9abd77b2e6b154 (diff) | |
download | mpv-8b0726b28a3d633a89dc660f2563266a0dcca69b.tar.bz2 mpv-8b0726b28a3d633a89dc660f2563266a0dcca69b.tar.xz |
demux_mkv: use new EBML parser for file header
Diffstat (limited to 'libmpdemux/ebml.c')
-rw-r--r-- | libmpdemux/ebml.c | 73 |
1 files changed, 0 insertions, 73 deletions
diff --git a/libmpdemux/ebml.c b/libmpdemux/ebml.c index 37e2fe0ffb..6eae1ef2c1 100644 --- a/libmpdemux/ebml.c +++ b/libmpdemux/ebml.c @@ -285,79 +285,6 @@ uint32_t ebml_read_master(stream_t *s, uint64_t *length) } -/* - * Read an EBML header. - */ -char *ebml_read_header(stream_t *s, int *version) -{ - uint64_t length, l, num; - uint32_t id; - char *str = NULL; - - if (ebml_read_master(s, &length) != EBML_ID_EBML) - return 0; - - if (version) - *version = 1; - - while (length > 0) { - id = ebml_read_id(s, NULL); - if (id == EBML_ID_INVALID) - return NULL; - length -= 2; - - switch (id) { - /* is our read version uptodate? */ - case EBML_ID_EBMLREADVERSION: - num = ebml_read_uint(s, &l); - if (num != EBML_VERSION) - return NULL; - break; - - /* we only handle 8 byte lengths at max */ - case EBML_ID_EBMLMAXSIZELENGTH: - num = ebml_read_uint(s, &l); - if (num != sizeof(uint64_t)) - return NULL; - break; - - /* we handle 4 byte IDs at max */ - case EBML_ID_EBMLMAXIDLENGTH: - num = ebml_read_uint(s, &l); - if (num != sizeof(uint32_t)) - return NULL; - break; - - case EBML_ID_DOCTYPE: - str = ebml_read_ascii(s, &l); - if (str == NULL) - return NULL; - break; - - case EBML_ID_DOCTYPEREADVERSION: - num = ebml_read_uint(s, &l); - if (num == EBML_UINT_INVALID) - return NULL; - if (version) - *version = num; - break; - - /* we ignore these two, they don't tell us anything we care about */ - case EBML_ID_VOID: - case EBML_ID_EBMLVERSION: - case EBML_ID_DOCTYPEVERSION: - default: - if (ebml_read_skip(s, &l)) - return NULL; - break; - } - length -= l; - } - - return str; -} - - #define EVALARGS(F, ...) F(__VA_ARGS__) #define E(str, N, type) const struct ebml_elem_desc ebml_ ## N ## _desc = { str, type }; |