From: StevenPuttemans Date: Fri, 9 Aug 2013 09:46:46 +0000 (+0200) Subject: Added fix mentioned in bug #3206 X-Git-Tag: accepted/tizen/6.0/unified/20201030.111113~1314^2~1108^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=d11746e56d46dc3679df5871aef6c1da5f8d0f99;p=platform%2Fupstream%2Fopencv.git Added fix mentioned in bug #3206 VideoWriter memory leak solved. --- diff --git a/modules/highgui/src/cap_ffmpeg_impl.hpp b/modules/highgui/src/cap_ffmpeg_impl.hpp index d494948..84222ad 100644 --- a/modules/highgui/src/cap_ffmpeg_impl.hpp +++ b/modules/highgui/src/cap_ffmpeg_impl.hpp @@ -1362,8 +1362,6 @@ bool CvVideoWriter_FFMPEG::writeFrame( const unsigned char* data, int step, int /// close video output stream and free associated memory void CvVideoWriter_FFMPEG::close() { - unsigned i; - // nothing to do if already released if ( !picture ) return; @@ -1419,13 +1417,6 @@ void CvVideoWriter_FFMPEG::close() av_free(outbuf); - /* free the streams */ - for(i = 0; i < oc->nb_streams; i++) - { - av_freep(&oc->streams[i]->codec); - av_freep(&oc->streams[i]); - } - if (!(fmt->flags & AVFMT_NOFILE)) { /* close the output file */ @@ -1443,7 +1434,7 @@ void CvVideoWriter_FFMPEG::close() } /* free the stream */ - av_free(oc); + avformat_free_context(oc); if( temp_image.data ) {