Skip to content

Implemented Buffer destructor mode - #44

Open
ydayan wants to merge 1 commit into
zmwangx:masterfrom
ydayan:feature/buffer_destructor_mode
Open

Implemented Buffer destructor mode#44
ydayan wants to merge 1 commit into
zmwangx:masterfrom
ydayan:feature/buffer_destructor_mode

Conversation

@ydayan

@ydayan ydayan commented Dec 23, 2020

Copy link
Copy Markdown

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