-
Notifications
You must be signed in to change notification settings - Fork 47
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
handle non-mandatory Empty Elements with default values correctly #72
Comments
|
I can confirm this bug. It seems libebml2 (used in mkclean and mkvalidator) has the same issue with a twist, it's possible to set elements to their default value when they are created. Except it's not used... |
Matroska elements affected by this bug:
Elements with a default value of 0 are not affected. |
BTW, are there files existing with a Length of 0 (to save space) ? Does mkvmerge use this feature for example ? It doesn't seem possible with libebml, even though the In that function it's used as
Where |
I haven't seen a single file using this shortcut for elements-with-default, at least not consciously. I have very vague memory of seeing files which wanted to store 0 / the empty string, though I really don't have any more details on that. |
The known basic types are:
This is good as it means that this new feature can't break old valid files (at least for integers and floats). |
So that should leave integers out of this issue. We can assume they were never written with a 0 length. It may not be the case for all muxers but they're probably not read correctly with well known demuxers. That leaves |
In section "6.1. Data Size Format" the EBML RFC states:
At the moment this simply isn't done. For example, the
EbmlUInteger::ReadData
function always uses 0 if it's an Empty Element. This works for elements whose default value is 0, of course, but not for others.BTW: the
EbmlUInteger::RenderData
function doesn't take default values into account either. To be honest, I prefer it that way as it will be less confusing to not fully spec-compliant EBML readers (such as libebml in its current state).The text was updated successfully, but these errors were encountered: