From ceb6585d265cda1b82bda8305815f3f605f2d73e Mon Sep 17 00:00:00 2001 From: David Schleef Date: Mon, 11 Feb 2013 11:54:46 -0800 Subject: [PATCH] videodecoder: warn if frame list gets long Decoders that get unparsed input are internally leaking nearly every incoming buffer. This checks that case. --- gst-libs/gst/video/gstvideodecoder.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/gst-libs/gst/video/gstvideodecoder.c b/gst-libs/gst/video/gstvideodecoder.c index e128b7b1c7..8e935c3b3c 100644 --- a/gst-libs/gst/video/gstvideodecoder.c +++ b/gst-libs/gst/video/gstvideodecoder.c @@ -2658,6 +2658,12 @@ gst_video_decoder_decode_frame (GstVideoDecoder * decoder, gst_video_codec_frame_ref (frame); priv->frames = g_list_append (priv->frames, frame); + + if (g_list_length (priv->frames) > 10) { + GST_WARNING_OBJECT (decoder, "decoder frame list getting long: %d frames," + "possible internal leaking?", g_list_length (priv->frames)); + } + frame->deadline = gst_segment_to_running_time (&decoder->input_segment, GST_FORMAT_TIME, frame->pts);