videodecoder: don't leak frames

Frames receive a refcount when added to the frames list so release that refcount
in gst_video_decoder_do_finish_frame(). Also release the ref on the frame
because gst_video_decoder_do_finish_frame() takes ownership of the passed frame.
This commit is contained in:
Wim Taymans 2012-05-01 14:46:06 +02:00 committed by Sebastian Dröge
parent e8c7f57a0a
commit 8fde7850c0

View file

@ -1865,8 +1865,11 @@ static void
gst_video_decoder_do_finish_frame (GstVideoDecoder * dec, gst_video_decoder_do_finish_frame (GstVideoDecoder * dec,
GstVideoCodecFrame * frame) GstVideoCodecFrame * frame)
{ {
/* unref once from the list */
dec->priv->frames = g_list_remove (dec->priv->frames, frame); dec->priv->frames = g_list_remove (dec->priv->frames, frame);
gst_video_codec_frame_unref (frame);
/* unref because this function takes ownership */
gst_video_codec_frame_unref (frame); gst_video_codec_frame_unref (frame);
} }