From 04f4a583dd9e91126ae1e5e6010f5d6c2d56b674 Mon Sep 17 00:00:00 2001 From: Mark Nauwelaerts Date: Tue, 29 Mar 2011 15:41:55 +0200 Subject: [PATCH] basevideocodec: fully free video frame --- gst-libs/gst/video/gstbasevideocodec.c | 4 ++++ gst-libs/gst/video/gstbasevideoencoder.c | 2 ++ 2 files changed, 6 insertions(+) diff --git a/gst-libs/gst/video/gstbasevideocodec.c b/gst-libs/gst/video/gstbasevideocodec.c index 7e96bd2fe0..07085f7304 100644 --- a/gst-libs/gst/video/gstbasevideocodec.c +++ b/gst-libs/gst/video/gstbasevideocodec.c @@ -178,5 +178,9 @@ gst_base_video_codec_free_frame (GstVideoFrame * frame) gst_buffer_unref (frame->sink_buffer); } + if (frame->src_buffer) { + gst_buffer_unref (frame->src_buffer); + } + g_free (frame); } diff --git a/gst-libs/gst/video/gstbasevideoencoder.c b/gst-libs/gst/video/gstbasevideoencoder.c index 5c9950c361..67b139454b 100644 --- a/gst-libs/gst/video/gstbasevideoencoder.c +++ b/gst-libs/gst/video/gstbasevideoencoder.c @@ -833,6 +833,8 @@ gst_base_video_encoder_finish_frame (GstBaseVideoEncoder * base_video_encoder, frame->src_buffer); } + /* handed out */ + frame->src_buffer = NULL; gst_base_video_codec_free_frame (frame); return ret;