You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've observed certain files (e.g. that one) become unreadable by MP3tag and foobar2000 after being modified with SpawnDev.EBML.
After a few tries, and with the help of mkvvalidator, I realized the problem is as follows :
EBML headers have their size encoded in a VINT (variable integer). This data structrure is supposed to take up just the right quantity of bytes for the value you want to store.
Certain softwares (including SpawnDev.EBML) do follow that rule and encode small numbers, say 35, as a VINT by using one single byte
Other softwares don't want to bother with over-optimization and always use 8 bytes even though they'd need just one. That's the case with the sample file linked above.
As a consequence, when SpawnDev.EBML rewrites such a file, there are a bunch of EBML headers that get rewritten, using 1 or 2 bytes instead of the default 8 they were initially lazily written with
I discovered that the values of the SeekPositions don't take these header size variations into account when being rewritten, thus resulting in file corruption. SpawnDev.EBML might assume all VINTs are written in an optimal way
(here, the difference in bytes between the position signalled by the SeekPoint and the actual position matches the difference in bytes between the sum of corresponding initial header sizes encoded with 8 bytes and the sum of the same header sized encoded optimally)
=> From where I stand, there are two ways to fix this :
A/ Make sure SpawnDev.EBML writes EBML headers while keeping the initial number of bytes their size has been initially encoded with
or
B/ Make sure any position shift is reflected in SeekPosition values, including shifts caused by VINT size changes
What's your take on that issue?
The text was updated successfully, but these errors were encountered:
Some of the spec does give suggestions to make files easier to edit after they are created. Leaving the SeekPosition the max (8 bytes) may be one of those suggestions.
Hey there~
I've observed certain files (e.g. that one) become unreadable by MP3tag and foobar2000 after being modified with SpawnDev.EBML.
After a few tries, and with the help of mkvvalidator, I realized the problem is as follows :
lazilywritten withSeekPosition
s don't take these header size variations into account when being rewritten, thus resulting in file corruption. SpawnDev.EBML might assume all VINTs are written in an optimal way(here, the difference in bytes between the position signalled by the SeekPoint and the actual position matches the difference in bytes between the sum of corresponding initial header sizes encoded with 8 bytes and the sum of the same header sized encoded optimally)
=> From where I stand, there are two ways to fix this :
A/ Make sure SpawnDev.EBML writes EBML headers while keeping the initial number of bytes their size has been initially encoded with
or
B/ Make sure any position shift is reflected in
SeekPosition
values, including shifts caused by VINT size changesWhat's your take on that issue?
The text was updated successfully, but these errors were encountered: