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
This commit is contained in:
Mark Nauwelaerts 2013-11-26 20:55:43 +01:00
parent 40d9f00106
commit 2ec4008ea5

View file

@ -539,11 +539,12 @@ gst_ffmpegviddec_video_frame_new (GstVideoCodecFrame * frame)
} }
static void static void
gst_ffmpegviddec_video_frame_free (GstFFMpegVidDecVideoFrame * frame) gst_ffmpegviddec_video_frame_free (GstFFMpegVidDec * ffmpegdec,
GstFFMpegVidDecVideoFrame * frame)
{ {
if (frame->mapped) if (frame->mapped)
gst_video_frame_unmap (&frame->vframe); 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); g_slice_free (GstFFMpegVidDecVideoFrame, frame);
} }
@ -768,7 +769,7 @@ gst_ffmpegviddec_release_buffer (AVCodecContext * context, AVFrame * picture)
/* we remove the opaque data now */ /* we remove the opaque data now */
picture->opaque = NULL; picture->opaque = NULL;
gst_ffmpegviddec_video_frame_free (frame); gst_ffmpegviddec_video_frame_free (ffmpegdec, frame);
/* zero out the reference in ffmpeg */ /* zero out the reference in ffmpeg */
for (i = 0; i < 4; i++) { for (i = 0; i < 4; i++) {