From a9162fc2eda614aac85670939f352bd2107bda37 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C3=A5vard=20Graff?= Date: Tue, 3 Dec 2019 11:23:01 +0000 Subject: [PATCH] gstharness: don't push the event to the queue before processing The application might pull and unref it by the time the code gets around to check it for EOS. --- libs/gst/check/gstharness.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libs/gst/check/gstharness.c b/libs/gst/check/gstharness.c index d6c26f6800..a82d0b44a0 100644 --- a/libs/gst/check/gstharness.c +++ b/libs/gst/check/gstharness.c @@ -277,13 +277,13 @@ gst_harness_sink_event (GstPad * pad, GstObject * parent, GstEvent * event) gst_object_unref (fwdpad); HARNESS_LOCK (h); } else { - g_async_queue_push (priv->sink_event_queue, event); if (GST_EVENT_TYPE (event) == GST_EVENT_EOS) { g_mutex_lock (&priv->buf_or_eos_mutex); priv->eos_received = TRUE; g_cond_signal (&priv->buf_or_eos_cond); g_mutex_unlock (&priv->buf_or_eos_mutex); } + g_async_queue_push (priv->sink_event_queue, event); } HARNESS_UNLOCK (h);