From: Sebastian Dröge Date: Mon, 27 May 2013 10:40:50 +0000 (+0200) Subject: pad: Store sticky events even if the pad is flushing X-Git-Tag: 1.1.1~23 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=73895c05b116bf0fcfc7c2b12d3f1b04688c8525;p=platform%2Fupstream%2Fgstreamer.git pad: Store sticky events even if the pad is flushing But do this only for events that are not dropped by flushing, i.e. do it only for everything except SEGMENT and EOS. Without this we might drop a CAPS event if flushing happens at an unfortunate time and nobody is resending the CAPS event. https://bugzilla.gnome.org/show_bug.cgi?id=700806 --- diff --git a/gst/gstpad.c b/gst/gstpad.c index dc2d8e0..731fda2 100644 --- a/gst/gstpad.c +++ b/gst/gstpad.c @@ -4451,13 +4451,20 @@ store_sticky_event (GstPad * pad, GstEvent * event) const gchar *name = NULL; gboolean insert = TRUE; - if (G_UNLIKELY (GST_PAD_IS_FLUSHING (pad))) + type = GST_EVENT_TYPE (event); + + /* Store all sticky events except SEGMENT/SEGMENT when we're flushing, + * otherwise they can be dropped and nothing would ever resend them. + * Only do that for activated pads though, everything else is a bug! + */ + if (G_UNLIKELY (GST_PAD_MODE (pad) == GST_PAD_MODE_NONE + || (GST_PAD_IS_FLUSHING (pad) && (type == GST_EVENT_SEGMENT + || type == GST_EVENT_EOS)))) goto flushed; if (G_UNLIKELY (GST_PAD_IS_EOS (pad))) goto eos; - type = GST_EVENT_TYPE (event); if (type & GST_EVENT_TYPE_STICKY_MULTI) name = gst_structure_get_name (gst_event_get_structure (event)); @@ -4527,7 +4534,7 @@ store_sticky_event (GstPad * pad, GstEvent * event) if (type == GST_EVENT_EOS) GST_OBJECT_FLAG_SET (pad, GST_PAD_FLAG_EOS); - return GST_FLOW_OK; + return GST_PAD_IS_FLUSHING (pad) ? GST_FLOW_FLUSHING : GST_FLOW_OK; /* ERRORS */ flushed: