[Matroska-devel] Unknown size
slhomme at matroska.org
Sat Sep 22 17:44:58 CEST 2012
On Thu, Sep 20, 2012 at 12:36 AM, Ralph Giles <giles at thaumas.net> wrote:
> On 12-09-15 6:49 AM, Steve Lhomme wrote:
>> In general an unknown size element ends when an element of similar or
>> higher level is found.
> Sorry, this confused me. How do I know I've found a new element at a
> similar level if I don't know the current element's size? I thought one
> had to rely on the parent element's size or, if that's also unknown, the
> end of the file.
> Is one supposed to scan for expected element tags instead?
That's how libebml does it, yes. When you're finished with an element
with known size you get a new ID and you find out if it's upper level,
same level or invalid.
In general unknown size is useful if it's also set in the Segment
element, ie the first level. You won't be able to parse correctly if
you use that as the max size to allow.
Matroska association Chairman
More information about the Matroska-devel