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

Implemented Buffer destructor mode #44

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ydayan
Copy link

@ydayan ydayan commented Dec 23, 2020

Hi :)

I use your library in order to decode jpegs from a Vec to a video, also as a Vec.
In order to do so I use the "wrap" function of the output context on an AVFromatContext I create myself.
The problem is, the Output destructor mode assumes it opened a file (which I have not) and performs avio_close on the ptr, which causes a double free.

Therefore, I added a third destructor mode "Buffer" that only preforms avformat_free_context. I myself am not sure about the name "Buffer", but it's better than "NotFile" so I'm open for suggestoins.

Also, If you would like, I can open a follow-up PR that adds my implementation of the in-memory context.

Thank you and waiting to here from you soon :)

added "wrap_buffer" functions to Input and Output
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant