From a314b682b2520415a62c474611ea514308336fa5 Mon Sep 17 00:00:00 2001 From: Michael Olbrich Date: Thu, 11 Dec 2014 12:02:38 +0100 Subject: [PATCH] vaapidecode: unref video codec frame twice MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit We get one reference when the frame is passed to decode_handle_frame() and create another one in gst_vaapi_decoder_push_frame(). Usually the frame is handled in gst_vaapidecode_push_decoded_frame(). Here the frame is always released twice: gst_video_decoder_finish_frame() + gst_video_codec_frame_unref() or gst_video_decoder_drop_frame() + gst_video_codec_frame_unref(). In gst_vaapidecode_reset_full() both references to the frame must be released as well. Signed-off-by: Víctor Manuel Jáquez Leal https://bugzilla.gnome.org/show_bug.cgi?id=743226 --- gst/vaapi/gstvaapidecode.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/gst/vaapi/gstvaapidecode.c b/gst/vaapi/gstvaapidecode.c index 05c9d0c..707efab 100644 --- a/gst/vaapi/gstvaapidecode.c +++ b/gst/vaapi/gstvaapidecode.c @@ -636,6 +636,7 @@ gst_vaapidecode_reset_full (GstVaapiDecode * decode, GstCaps * caps, /* Reset timers if hard reset was requested (e.g. seek) */ if (hard) { + GstVideoDecoder *const vdec = GST_VIDEO_DECODER (decode); GstVideoCodecFrame *out_frame = NULL; gst_vaapi_decoder_flush (decode->decoder); @@ -643,6 +644,7 @@ gst_vaapidecode_reset_full (GstVaapiDecode * decode, GstCaps * caps, /* Purge all decoded frames as we don't need them (e.g. seek) */ while (gst_vaapi_decoder_get_frame_with_timeout (decode->decoder, &out_frame, 0) == GST_VAAPI_DECODER_STATUS_SUCCESS) { + gst_video_decoder_drop_frame (vdec, out_frame); gst_video_codec_frame_unref (out_frame); out_frame = NULL; } -- 2.7.4