I
I
izac2017-07-31 02:05:28
C++ / C#
izac, 2017-07-31 02:05:28

Parsing EBML Void element?

Good afternoon, I want to warn you that I am faced with such tasks for the first time, therefore I can ask obvious things for someone, please do not kick me for this. I decided to parse the webm file, namely to check and get the Void element, I found an example on the github ( https://gist.github.com/mganeko/9ceee931ac5dde298e81 ) but as it turned out it does not work. I decided to find and fix the error, I figured out the code and the algorithm itself, but apparently I'm missing some detail from the specification ( https://matroska.org/technical/specs/index.html) , the problem is that this code shows that absolutely in all the same Void element with the same value , but for example (EBML Inspect) says something else. According to the algorithm, after finding 2 top-level elements (EBML and Segment), it works correctly here, the buffer pointer finds the [EC] byte (as it is written in the specification), but then it takes the adjacent byte (0x86) and, according to the same specification, its dimension is 1 byte and exits, but in fact the data 0xEC comes just after this byte (86) another 5 bytes (for example, in EBML Inspect it shows 39 33 34 39 35 39 ). So the question is what am I missing?
PS Added the C++ tag because I think they come across this kind of work more often in their day to day work.

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question