From 5109173abfe71b9402eec3fb9140bd76a322cc7a Mon Sep 17 00:00:00 2001 From: Song Bing Date: Fri, 12 Jun 2015 16:52:46 +0800 Subject: pad: Clear EOS flag after received STREAM_START event Clear EOS flag after received STREAM_START event https://bugzilla.gnome.org/show_bug.cgi?id=750761 --- gst/gstpad.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'gst') diff --git a/gst/gstpad.c b/gst/gstpad.c index 962f2fdb3..c4e8ff25f 100644 --- a/gst/gstpad.c +++ b/gst/gstpad.c @@ -4823,6 +4823,14 @@ store_sticky_event (GstPad * pad, GstEvent * event) || type == GST_EVENT_EOS)))) goto flushed; + /* Unset the EOS flag when received STREAM_START event, so pad can + * store sticky event and then push it later */ + if (type == GST_EVENT_STREAM_START) { + GST_LOG_OBJECT (pad, "Removing pending EOS events"); + remove_event_by_type (pad, GST_EVENT_EOS); + GST_OBJECT_FLAG_UNSET (pad, GST_PAD_FLAG_EOS); + } + if (G_UNLIKELY (GST_PAD_IS_EOS (pad))) goto eos; @@ -5317,6 +5325,17 @@ gst_pad_send_event_unchecked (GstPad * pad, GstEvent * event, if (G_UNLIKELY (GST_PAD_IS_FLUSHING (pad))) goto flushing; + switch (event_type) { + case GST_EVENT_STREAM_START: + /* Remove sticky EOS events */ + GST_LOG_OBJECT (pad, "Removing pending EOS events"); + remove_event_by_type (pad, GST_EVENT_EOS); + GST_OBJECT_FLAG_UNSET (pad, GST_PAD_FLAG_EOS); + break; + default: + break; + } + if (serialized) { if (G_UNLIKELY (GST_PAD_IS_EOS (pad))) goto eos; -- cgit v1.2.3