cetium / qtffmpegwrapper

Automatically exported from code.google.com/p/qtffmpegwrapper
Other
1 stars 0 forks source link

Memory leak in QVideoEncoder #6

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
img_convert_ctx isn't freed on close()

ffmpeg::sws_getCachedContext() tries to use an already existing context but 
fails because initVars() sets img_convert_ctx to zero. So a new context is 
allocated on every new video.

Adding the following lines to QVideoEncoder::close() (before initVars) solves 
the problem:
// free the sws-context
sws_freeContext(img_convert_ctx);

Another solution would be of course to remove the corresponding line from 
initVars()

regards

Frederik Pasch

Original issue reported on code.google.com by fpa...@googlemail.com on 14 Feb 2011 at 2:36