From fcaf5b0f0bd3e85441133caa634b4ebd90bdfc7d Mon Sep 17 00:00:00 2001 From: "Jan Alexander Steffens (heftig)" Date: Thu, 21 Oct 2021 00:31:24 +0200 Subject: [PATCH] interlace: Reset after changing state to READY Trying to reset before the pads have been deactivated races with the streaming thread. There was also a buggy buffer clear leaving a dangling `stored_frame` pointer around. Use `gst_interlace_reset` so this happens properly. Part-of: --- subprojects/gst-plugins-bad/gst/interlace/gstinterlace.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/subprojects/gst-plugins-bad/gst/interlace/gstinterlace.c b/subprojects/gst-plugins-bad/gst/interlace/gstinterlace.c index d40fbce..62bbf30 100644 --- a/subprojects/gst-plugins-bad/gst/interlace/gstinterlace.c +++ b/subprojects/gst-plugins-bad/gst/interlace/gstinterlace.c @@ -1514,23 +1514,23 @@ static GstStateChangeReturn gst_interlace_change_state (GstElement * element, GstStateChange transition) { GstInterlace *interlace = GST_INTERLACE (element); + GstStateChangeReturn ret; + + ret = GST_ELEMENT_CLASS (parent_class)->change_state (element, transition); switch (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); + + gst_interlace_reset (interlace); break; default: break; } - return GST_ELEMENT_CLASS (parent_class)->change_state (element, transition); + return ret; } static gboolean -- 2.7.4