-
Notifications
You must be signed in to change notification settings - Fork 50
Fix filter graph memory leak #274
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
Fix filter graph memory leak #274
Conversation
I thought it was done each time here ;
If this does not work, this intruction should be removed... In which case you saw a memory leak ? |
@@ -550,6 +550,10 @@ bool StreamTranscoder::processTranscode() | |||
LOG_DEBUG("Convert") | |||
_transform->convert(*_filteredData, *_transformedData); | |||
|
|||
// free the filtered AVFrame now it has been converted into another one |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you add a warning in the doc of the FilterGraph::process method about that ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Of course, 6ab2b3c!
…irectly the av_frame_unref function And removes redundant documentation
Actually, this code is only executed if there is no filter to apply. The problem is that we have to free the AVFrame each time we apply the filter graph. Without this clear, the memory usage grows all along the process until it is completely full. This appears on processing long medias (muxing audio channels extracted from movies, for instance). |
Ok great ! So this code at
|
Yes, actually this code is necessary if no filter has been added to the FilterGraph. |
Each time we use the av_buffersink_get_frame function, we have to free the output AVFrame.
See the av_buffersink_get_frame documentation.