diff options
author | Kazunori Kobayashi <kkobayas@igel.co.jp> | 2015-12-03 11:53:05 +0900 |
---|---|---|
committer | Sebastian Dröge <sebastian@centricular.com> | 2015-12-21 12:43:10 +0100 |
commit | 565386874ec8bb3e64c62067dfd2a8b6c2db07f0 (patch) | |
tree | a997c000e469840cfa72fa0de6d817a03672bd50 | |
parent | 2270f66853daeee955ad86bb6e3fbefcd5a51b3e (diff) | |
download | gstreamer-plugins-base-565386874ec8bb3e64c62067dfd2a8b6c2db07f0.tar.gz |
appsrc: Clear is_eos flag when receiving the flush-stop event
The EOS event can be propagated to the downstream elements when
is_eos flag remains set even after leaving the flushing state.
This fix allows this element to normally restart the streaming
after receiving the flush event by clearing the is_eos flag.
https://bugzilla.gnome.org/show_bug.cgi?id=759110
-rw-r--r-- | gst-libs/gst/app/gstappsrc.c | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/gst-libs/gst/app/gstappsrc.c b/gst-libs/gst/app/gstappsrc.c index e540cf427..fff99e949 100644 --- a/gst-libs/gst/app/gstappsrc.c +++ b/gst-libs/gst/app/gstappsrc.c @@ -237,6 +237,7 @@ static gboolean gst_app_src_do_seek (GstBaseSrc * src, GstSegment * segment); static gboolean gst_app_src_is_seekable (GstBaseSrc * src); static gboolean gst_app_src_do_get_size (GstBaseSrc * src, guint64 * size); static gboolean gst_app_src_query (GstBaseSrc * src, GstQuery * query); +static gboolean gst_app_src_event (GstBaseSrc * src, GstEvent * event); static GstFlowReturn gst_app_src_push_buffer_action (GstAppSrc * appsrc, GstBuffer * buffer); @@ -528,6 +529,7 @@ gst_app_src_class_init (GstAppSrcClass * klass) basesrc_class->is_seekable = gst_app_src_is_seekable; basesrc_class->get_size = gst_app_src_do_get_size; basesrc_class->query = gst_app_src_query; + basesrc_class->event = gst_app_src_event; klass->push_buffer = gst_app_src_push_buffer_action; klass->push_sample = gst_app_src_push_sample_action; @@ -1904,3 +1906,22 @@ gst_app_src_uri_handler_init (gpointer g_iface, gpointer iface_data) iface->get_uri = gst_app_src_uri_get_uri; iface->set_uri = gst_app_src_uri_set_uri; } + +static gboolean +gst_app_src_event (GstBaseSrc * src, GstEvent * event) +{ + GstAppSrc *appsrc = GST_APP_SRC_CAST (src); + GstAppSrcPrivate *priv = appsrc->priv; + + switch (GST_EVENT_TYPE (event)) { + case GST_EVENT_FLUSH_STOP: + g_mutex_lock (&priv->mutex); + priv->is_eos = FALSE; + g_mutex_unlock (&priv->mutex); + break; + default: + break; + } + + return GST_BASE_SRC_CLASS (parent_class)->event (src, event); +} |