From 34bfcb2af95d7b25cb8671247e17777da69dca3b Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Tue, 1 May 2012 15:35:47 +0200 Subject: [PATCH] videodecoder: don't leak events When need to push out all the previously received events, concatenate all the events from the previous frames (instead of leaking the old ones) Improve debugging a little Conflicts: gst-libs/gst/video/gstvideodecoder.c --- gst-libs/gst/video/gstvideodecoder.c | 8 ++++---- gst-libs/gst/video/gstvideoutils.c | 2 ++ 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/gst-libs/gst/video/gstvideodecoder.c b/gst-libs/gst/video/gstvideodecoder.c index 11ebb69..8ce54fb 100644 --- a/gst-libs/gst/video/gstvideodecoder.c +++ b/gst-libs/gst/video/gstvideodecoder.c @@ -1778,7 +1778,7 @@ gst_video_decoder_prepare_finish_frame (GstVideoDecoder * #endif GST_LOG_OBJECT (decoder, - "finish frame sync=%d pts=%" GST_TIME_FORMAT, + "finish frame %p sync=%d pts=%" GST_TIME_FORMAT, frame, GST_VIDEO_CODEC_FRAME_IS_SYNC_POINT (frame), GST_TIME_ARGS (frame->pts)); /* Push all pending events that arrived before this frame */ @@ -1786,7 +1786,7 @@ gst_video_decoder_prepare_finish_frame (GstVideoDecoder * GstVideoCodecFrame *tmp = l->data; if (tmp->events) { - events = tmp->events; + events = g_list_concat (events, tmp->events); tmp->events = NULL; } @@ -1894,7 +1894,7 @@ gst_video_decoder_drop_frame (GstVideoDecoder * dec, GstVideoCodecFrame * frame) GstMessage *qos_msg; gdouble proportion; - GST_LOG_OBJECT (dec, "drop frame"); + GST_LOG_OBJECT (dec, "drop frame %p", frame); GST_VIDEO_DECODER_STREAM_LOCK (dec); @@ -1954,7 +1954,7 @@ gst_video_decoder_finish_frame (GstVideoDecoder * decoder, guint64 start, stop; GstSegment *segment; - GST_LOG_OBJECT (decoder, "finish frame"); + GST_LOG_OBJECT (decoder, "finish frame %p", frame); if (G_UNLIKELY (priv->output_state_changed || (priv->output_state && gst_pad_check_reconfigure (decoder->srcpad)))) diff --git a/gst-libs/gst/video/gstvideoutils.c b/gst-libs/gst/video/gstvideoutils.c index 6f12fb8..a47a6ef 100644 --- a/gst-libs/gst/video/gstvideoutils.c +++ b/gst-libs/gst/video/gstvideoutils.c @@ -36,6 +36,8 @@ _gst_video_codec_frame_free (GstVideoCodecFrame * frame) { g_return_if_fail (frame != NULL); + GST_DEBUG ("free frame %p", frame); + if (frame->input_buffer) { gst_buffer_unref (frame->input_buffer); } -- 2.7.4