From 2ec4008ea5f3296f50d56b11422ed5d56de6692b Mon Sep 17 00:00:00 2001 From: Mark Nauwelaerts Date: Tue, 26 Nov 2013 20:55:43 +0100 Subject: [PATCH] avviddec: really release frame at proper time ... by also removing it from the pending list of frames, where it may still be in if it has never been submitted to _finish. This could happen if is a decode-only frame, or in skipped decoding situation, ... Fixes https://bugzilla.gnome.org/show_bug.cgi?id=693772 --- ext/libav/gstavviddec.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/ext/libav/gstavviddec.c b/ext/libav/gstavviddec.c index 063576718e..689cdebca2 100644 --- a/ext/libav/gstavviddec.c +++ b/ext/libav/gstavviddec.c @@ -539,11 +539,12 @@ gst_ffmpegviddec_video_frame_new (GstVideoCodecFrame * frame) } static void -gst_ffmpegviddec_video_frame_free (GstFFMpegVidDecVideoFrame * frame) +gst_ffmpegviddec_video_frame_free (GstFFMpegVidDec * ffmpegdec, + GstFFMpegVidDecVideoFrame * frame) { if (frame->mapped) gst_video_frame_unmap (&frame->vframe); - gst_video_codec_frame_unref (frame->frame); + gst_video_decoder_release_frame (GST_VIDEO_DECODER (ffmpegdec), frame->frame); g_slice_free (GstFFMpegVidDecVideoFrame, frame); } @@ -768,7 +769,7 @@ gst_ffmpegviddec_release_buffer (AVCodecContext * context, AVFrame * picture) /* we remove the opaque data now */ picture->opaque = NULL; - gst_ffmpegviddec_video_frame_free (frame); + gst_ffmpegviddec_video_frame_free (ffmpegdec, frame); /* zero out the reference in ffmpeg */ for (i = 0; i < 4; i++) {