Skip to content
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

Move the size information in EbmlCallbacks #272

Open
robUx4 opened this issue Feb 25, 2024 · 2 comments
Open

Move the size information in EbmlCallbacks #272

robUx4 opened this issue Feb 25, 2024 · 2 comments
Labels
abi-break breaks the ABI (e.g. programs linked against the library have to be recompiled) api-break breaks the API (e.g. programs using it will have to adjust their source code) enhancement

Comments

@robUx4
Copy link
Contributor

robUx4 commented Feb 25, 2024

SizeIsValid() is used before reading the data. It's only used to check the header if the size is valid. So we could move the check in the EbmlCallbacks (holding the specs of each element).

Eventually we can also avoid allocating an element if we know beforehand the size is not valid.

@robUx4 robUx4 added enhancement api-break breaks the API (e.g. programs using it will have to adjust their source code) abi-break breaks the ABI (e.g. programs linked against the library have to be recompiled) labels Feb 25, 2024
@robUx4
Copy link
Contributor Author

robUx4 commented Feb 25, 2024

The problem is that EbmlCallbacks are constexpr classes, and we can't have virtual methods in there...

@robUx4
Copy link
Contributor Author

robUx4 commented Feb 25, 2024

It is possible with an old school C callback type. We already use one for the Creator.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
abi-break breaks the ABI (e.g. programs linked against the library have to be recompiled) api-break breaks the API (e.g. programs using it will have to adjust their source code) enhancement
Projects
None yet
Development

No branches or pull requests

1 participant