From f6943a3cdf4bc5731e40e4c6b1f63504b0ff6001 Mon Sep 17 00:00:00 2001 From: Jan Schmidt Date: Sun, 1 Nov 2015 00:04:27 +1100 Subject: [PATCH] pad: Mark sticky events as sent on not-linked Instead of re-sending sticky events over and over to a not-linked pad, mark them as sent the first time. If the not-linked came from downstream, it already received the events. If the pad is actually not-linked, the sticky events will be rescheduled when the pad is linked anyway. --- gst/gstpad.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/gst/gstpad.c b/gst/gstpad.c index 9fea17e1e7..7f1cb1db2e 100644 --- a/gst/gstpad.c +++ b/gst/gstpad.c @@ -3713,11 +3713,12 @@ push_sticky (GstPad * pad, PadEvent * ev, gpointer user_data) break; case GST_FLOW_NOT_LINKED: /* not linked is not a problem, we are sticky so the event will be - * sent later but only for non-EOS events */ + * rescheduled to be sent later on re-link, but only for non-EOS events */ GST_DEBUG_OBJECT (pad, "pad was not linked, mark pending"); - if (GST_EVENT_TYPE (event) != GST_EVENT_EOS) + if (GST_EVENT_TYPE (event) != GST_EVENT_EOS) { data->ret = GST_FLOW_OK; - GST_OBJECT_FLAG_SET (pad, GST_PAD_FLAG_PENDING_EVENTS); + ev->received = TRUE; + } break; default: GST_DEBUG_OBJECT (pad, "result %s, mark pending events",