videodecoder: Do not unref frame if not in the list

This commit is contained in:
Matej Knopp 2012-06-02 09:34:15 -04:00 committed by Sebastian Dröge
parent 2667d4bb82
commit e316ff5435

View file

@ -1865,9 +1865,14 @@ static void
gst_video_decoder_do_finish_frame (GstVideoDecoder * dec,
GstVideoCodecFrame * frame)
{
GList *link;
/* unref once from the list */
dec->priv->frames = g_list_remove (dec->priv->frames, frame);
gst_video_codec_frame_unref (frame);
link = g_list_find (dec->priv->frames, frame);
if (link) {
gst_video_codec_frame_unref (frame);
dec->priv->frames = g_list_delete_link (dec->priv->frames, link);
}
/* unref because this function takes ownership */
gst_video_codec_frame_unref (frame);