First, you'd have to read the element ID. ebml_read_element() doesn't do that, because it's supposed to be called when you found an element already (i.e. you read its ID).

Second, if you'd read the element here, you would rely that it _always_ comes here in the physical file, which is generally probably not guaranteed (unless we're talking about nested elements, in which case you could do a parsing loop). I haven't checked what the file structure here is, so I'm not entirely sure.

It's possible that you have to parse the elements separately, as soon as you happen to find them in read_header_element().

Also, calling ``s->seek`` is not allowed, because it doesn't update the stream position and buffer correctly. You should call ``stream_seek()``. Seeking to 0 would seek to the start of the file, maybe not what's wanted.