From cde4e74eca34fa825a00597d991f7cf2039d621b Mon Sep 17 00:00:00 2001 From: Vivia Nikolaidou Date: Mon, 8 Mar 2021 20:59:14 +0200 Subject: [PATCH] interlace: Discard stored_frame on EOS and PAUSED_TO_READY Would otherwise leak it. Part-of: --- gst/interlace/gstinterlace.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/gst/interlace/gstinterlace.c b/gst/interlace/gstinterlace.c index a49d974d9c..ac109af20a 100644 --- a/gst/interlace/gstinterlace.c +++ b/gst/interlace/gstinterlace.c @@ -678,6 +678,10 @@ gst_interlace_sink_event (GstPad * pad, GstObject * parent, GstEvent * event) } #endif + if (interlace->stored_frame) { + gst_buffer_unref (interlace->stored_frame); + interlace->stored_frame = NULL; + } ret = gst_pad_push_event (interlace->srcpad, event); break; case GST_EVENT_CAPS: @@ -1471,6 +1475,9 @@ gst_interlace_change_state (GstElement * element, GstStateChange transition) case GST_STATE_CHANGE_PAUSED_TO_READY: g_mutex_lock (&interlace->lock); interlace->src_fps_n = 0; + if (interlace->stored_frame) { + gst_buffer_unref (interlace->stored_frame); + } g_mutex_unlock (&interlace->lock); /* why? */ //gst_interlace_reset (interlace);