-
Notifications
You must be signed in to change notification settings - Fork 24
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
Element type default values (not the attribute "default") #403
Comments
The specs says
There is an issue with how to interpret an empty Master element. It's the one type that is not mentioned above and yet is allowed to be empty: I think we're missing an explanation on how to handle this case. IIRC in libebml the mandatory children with a default value are automatically added to an EbmlMaster on creation, so it's always there with the default value unless overwritten. IMO that's the way to go: "empty Master Elements should be interpreted with their mandatory elements present as empty elements (so using 0 /empty string/empty master)." This is related to the issue on how to handle mandatory elements #394. |
Yes, for EBML is this correct (an empty string is used), but not for Matroska, because the
Yes, no attribute default value can be used for MasterElements, but the type default value says: type default is when the MasterElement has no sub-elements -> empty MasterElement
The term "default value" was no correct. I meant the element type default value. |
There is nothing in the current spec that says
Not yet.
Definitely not. libmatroska should not take the liberty to invent default values for elements. And we already established that the default value of |
Rather than the |
Given some elements are not legal as empty elements (that may not just be for strings, binary UIDs cannot be empty either), some Master elements also cannot be empty. This is already related to the |
The specs say that all non-Master element types have a default value if the data size = 0.
For example the Unsigend Integer Element has a type default value of 0.
This means in Matroska when the
ChapterTimeStart
element is present in a file but have no data(data size length = 0), I can use a value of 0 for the start time?The
ChapterTimeStart
element has no attribute "default" but there is a default value because the element type default value can be used instead.The
ChapLanguageIETF
element is a type of String and has restriction to the value. This element must not have empty data, but the String element type default value is an empty string.This means when such an element is in the file without data -> thats illegal?!
Master elements:
In the ebml lib code is also a default value coded: when the Master element has no data (no sub elements in the list) then is the default = true.
This is fine to me, because no data means an empty master element.
The problem here is, when the Master element has elements with mandatory attribute without default value.
A conclusion for me is:
All elements have a default value.
And for some elements is the default value illegal.
How wrong am I with that?
The text was updated successfully, but these errors were encountered: