Updated comments about freeing format_ctx->pb->buffer.

Signed-off-by: Lukasz Gromanowski <lgromanowski@gmail.com>
This commit is contained in:
Lukasz Gromanowski 2014-01-01 17:05:49 +01:00
parent 1ce4663065
commit 2d4e06cd50
2 changed files with 11 additions and 8 deletions

View file

@ -949,7 +949,9 @@ void VideoState::init(const std::string& resourceName)
this->format_ctx->pb = ioCtx; this->format_ctx->pb = ioCtx;
// Open video file // Open video file
/// \todo leak here, ffmpeg or valgrind bug ? ///
/// format_ctx->pb->buffer must be freed by hand,
/// if not, valgrind will show memleak, see:
/// ///
/// https://trac.ffmpeg.org/ticket/1357 /// https://trac.ffmpeg.org/ticket/1357
/// ///
@ -1023,11 +1025,12 @@ void VideoState::deinit()
if(this->format_ctx) if(this->format_ctx)
{ {
// valgrind shows memleak near format_ctx->pb ///
// /// format_ctx->pb->buffer must be freed by hand,
// As scrawl pointed, memleak could be related to this ffmpeg ticket: /// if not, valgrind will show memleak, see:
// https://trac.ffmpeg.org/ticket/1357 ///
// /// https://trac.ffmpeg.org/ticket/1357
///
if (this->format_ctx->pb != NULL) if (this->format_ctx->pb != NULL)
{ {
av_free(this->format_ctx->pb->buffer); av_free(this->format_ctx->pb->buffer);

View file

@ -231,9 +231,9 @@ void FFmpeg_Decoder::close()
{ {
if (mFormatCtx->pb != NULL) if (mFormatCtx->pb != NULL)
{ {
// valgrind shows memleak near mFormatCtx->pb // mFormatCtx->pb->buffer must be freed by hand,
// if not, valgrind will show memleak, see:
// //
// As scrawl pointed, memleak could be related to this ffmpeg ticket:
// https://trac.ffmpeg.org/ticket/1357 // https://trac.ffmpeg.org/ticket/1357
// //
if (mFormatCtx->pb->buffer != NULL) if (mFormatCtx->pb->buffer != NULL)