From 430285b5c88bec2a0cde513cf09906440795be7f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Thu, 9 May 2013 10:59:41 +0200 Subject: [PATCH] pad: Only let gst_pad_sticky_events_foreach() iterate over existing events --- gst/gstpad.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/gst/gstpad.c b/gst/gstpad.c index c355db24a2..45095544c4 100644 --- a/gst/gstpad.c +++ b/gst/gstpad.c @@ -5174,11 +5174,13 @@ foreach_dispatch_function (GstPad * pad, PadEvent * ev, gpointer user_data) ForeachDispatch *data = user_data; gboolean ret; - GST_OBJECT_UNLOCK (pad); + if (ev->event) { + GST_OBJECT_UNLOCK (pad); - ret = data->func (pad, &ev->event, data->user_data); + ret = data->func (pad, &ev->event, data->user_data); - GST_OBJECT_LOCK (pad); + GST_OBJECT_LOCK (pad); + } return ret; }