Commit 2ec4008e authored by Mark Nauwelaerts's avatar Mark Nauwelaerts

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
parent 40d9f001
......@@ -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++) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment