[Matroska-devel] Question about Test Suite

Moritz Bunkus moritz at bunkus.org
Fri Jul 24 09:00:37 CEST 2015


> How does mkvinfo get to 451452 to begin reading the next element
> instead?

mkvinfo uses libebml's EbmlMaster::Read() function for reading a cluster
en bloc and then outputs which elements libebml has found.

EbmlMaster::Read() uses EbmlEmenet::FindNextElement() under the hood
for finding the next ID. And that function reads as many bytes as
needed for forming a valid ID.

So if the byte at position 451451 happens to be 0 (which I haven't
verified, mind you) then it will probably be skipped as an EBML ID's
first byte is never 0. Similar reasoning for other values for the
first byte, e.g. anything smaller than 0x10 would be invalid as EBML
IDs can only be four bytes long, and the position of first bit set to
1 determines the size of the EBML ID.

Kind regards,
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.matroska.org/pipermail/matroska-devel/attachments/20150724/00215345/attachment.sig>

More information about the Matroska-devel mailing list