-
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
Don't export EbmlMaster context, use the class static member #269
Conversation
7e03bb6
to
41895bd
Compare
Unfortunately this breaks this function & several other similar ones in MKVToolNix. The error message is:
Any pointers how I would have to change my code? I need to iterate over the whole semantic tree & find elements, either by their ID, or by their debug name. |
I got the same problem in mkvalidator. I pushed a fix. |
Compilation still fails after merging 9e6f5b5 (& 'hide_context' for libMatroska) with the same error message I've posted above. Meaning the same issue remains; I need to be able to iterate over the whole structure, and I don't know how after these changes. |
OK, I see the problem. Now that there's stronger typing you can only get a child I'll make the patches for mkvtoolnix. |
As written over on Gitlab, but to keep the conversation here: I needed a couple of fixes on top of your MKVToolNix PR to make MKVToolNix compile. Afterwards a handful of my test cases fail. I've now found out why they fail: After the PR the file pointer is now directly at the start of the cluster's data portion (directly after the cluster's head). I consider the new behavior to be bad & wrong. A typical algorithm used by MKVToolNix is to create a list of level 1 elements like this:
This worked fine with the old behavior. With the new one the "skip over it" part will leave the file pointer after the level 1 element's head, meaning that the next "find next ID" call will find the ID of the first child element of that level 1 element. That is a substantial change in semantics. Sure, I could work around this, but I shouldn't have to, in my opinion, as the new behavior is strictly worse to the old one. Unfortunately I really don't understand why the changes in this PR affect skipping data that way & can therefore not offer a fix myself. |
BTW, the file in question is this one. |
I removed the |
It doesn't make sense for other types on element/context. The size if kept in the EbmlSemanticContext to notify when it's a master element.
It can only be context with a list of elements.
EbmlHead is public/shared class. One can call EbmlHead::GetContextMaster();
Even though it's not very useful as a static member variable...
… any master class This is the counterpart to EBML_CLASS_CONTEXT for master elements.
It's only used with master element classes in mkvtoolnix of VLC. This will make iterating through the class context children possible without any code change.
Hopefully the compiler picks the most appropriate one ?
I think I identified the source of the issue. The |
Yep, that was it. Thanks! |
The internal are reworked so only semantic context of EbmlMaster elements have a table of possible children.
"[Get]ElementSpec()" is generalized so there's stronger typing of the semantic context for all the types.
The callback to get the global elements now returns a
EbmlSemanticContextMaster
. Ultimately it only needs to return a container with a list of semantic context.