}
}
+/* must be called with pad object lock */
static gboolean
-gst_pad_store_sticky_event (GstPad * pad, GstEvent * event, gboolean locked)
+gst_pad_store_sticky_event (GstPad * pad, GstEvent * event)
{
guint i, len;
GstEventType type;
switch (GST_EVENT_TYPE (event)) {
case GST_EVENT_CAPS:
- if (locked)
- GST_OBJECT_UNLOCK (pad);
+ GST_OBJECT_UNLOCK (pad);
GST_DEBUG_OBJECT (pad, "notify caps");
g_object_notify_by_pspec ((GObject *) pad, pspec_caps);
- if (locked)
- GST_OBJECT_LOCK (pad);
+ GST_OBJECT_LOCK (pad);
break;
default:
break;
if (G_UNLIKELY (GST_PAD_IS_EOS (pad)))
goto eos;
- /* srcpad sticky events are store immediately, the received flag is set
+ /* srcpad sticky events are stored immediately, the received flag is set
* to FALSE and will be set to TRUE when we can successfully push the
* event to the peer pad */
- if (gst_pad_store_sticky_event (pad, event, TRUE)) {
+ if (gst_pad_store_sticky_event (pad, event)) {
GST_DEBUG_OBJECT (pad, "event %s updated", GST_EVENT_TYPE_NAME (event));
}
if (GST_EVENT_TYPE (event) == GST_EVENT_EOS)
if (sticky) {
if (ret == GST_FLOW_OK) {
+ GST_OBJECT_LOCK (pad);
+ /* can't store on flushing pads */
+ if (G_UNLIKELY (GST_PAD_IS_FLUSHING (pad)))
+ goto flushing;
+
+ if (G_UNLIKELY (GST_PAD_IS_EOS (pad)))
+ goto eos;
+
/* after the event function accepted the event, we can store the sticky
* event on the pad */
- gst_pad_store_sticky_event (pad, event, FALSE);
+ if (gst_pad_store_sticky_event (pad, event)) {
+ GST_DEBUG_OBJECT (pad, "event %s updated", GST_EVENT_TYPE_NAME (event));
+ }
if (event_type == GST_EVENT_EOS)
GST_OBJECT_FLAG_SET (pad, GST_PAD_FLAG_EOS);
+
+ GST_OBJECT_UNLOCK (pad);
}
gst_event_unref (event);
}