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

AP4_AtomFactory only gives 32-bit size to TypeHandler #42

Open
fumoboy007 opened this issue Nov 25, 2015 · 2 comments
Open

AP4_AtomFactory only gives 32-bit size to TypeHandler #42

fumoboy007 opened this issue Nov 25, 2015 · 2 comments

Comments

@fumoboy007
Copy link

From lines 752–764 of Ap4AtomFactory.cpp:

default: {
    // try all the external type handlers
    AP4_List<TypeHandler>::Item* handler_item = m_TypeHandlers.FirstItem();
    while (handler_item) {
        TypeHandler* handler = handler_item->GetData();
        if (AP4_SUCCEEDED(handler->CreateAtom(type, size_32, stream, GetContext(), atom))) {
            break;
        }
        handler_item = handler_item->GetNext();
    }

    break;
}

The TypeHandler only gets passed the 32-bit size. :-(

@barbibulle
Copy link
Contributor

That's true. It is a current limitation. However, we've never run into this as an issue in practice, since the only atoms with a 64-bit size we've encountered are 'mdat' atoms for which there's never been a need to have a custom type handler. Do you have a use case where you need to write a custom type handler for atoms larger than 2^32 bytes?

@fumoboy007
Copy link
Author

I don’t have a use case for this. I was writing an implementation for #41 and I noticed that custom atoms only get the 32-bit size.

Now that I think about it, a non-mdat atom with size greater than 4 GB wouldn’t really make sense. It would be nice if custom atoms got the 64-bit size too though. Thanks for adding the “enhancement” label.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants