diff options
author | Sebastian Dröge <sebastian@centricular.com> | 2016-05-14 17:31:51 +0300 |
---|---|---|
committer | Tim-Philipp Müller <tim@centricular.com> | 2016-05-19 22:12:09 +0100 |
commit | 9dfcdec02b055b214411dd1965999d605605c2d5 (patch) | |
tree | d9024516eb86de9d0cbed4bde9aeccf1e86639ff | |
parent | 7c65287c03646fa73819262a05f30acb47871d38 (diff) | |
download | gstreamer-9dfcdec02b055b214411dd1965999d605605c2d5.tar.gz |
basesink/src: Post an error message if ::start() fails
The subclass should do that already, but just in case do it ourselves too as a
fallback. Without this, e.g. playbin will just wait forever if this fails
because it is triggered as part of an ASYNC state change.
-rw-r--r-- | libs/gst/base/gstbasesink.c | 4 | ||||
-rw-r--r-- | libs/gst/base/gstbasesrc.c | 5 |
2 files changed, 8 insertions, 1 deletions
diff --git a/libs/gst/base/gstbasesink.c b/libs/gst/base/gstbasesink.c index 9ad65c8053..035895101e 100644 --- a/libs/gst/base/gstbasesink.c +++ b/libs/gst/base/gstbasesink.c @@ -5238,6 +5238,10 @@ gst_base_sink_change_state (GstElement * element, GstStateChange transition) start_failed: { GST_DEBUG_OBJECT (basesink, "failed to start"); + /* subclass is supposed to post a message but we post one as a fallback + * just in case */ + GST_ELEMENT_ERROR (basesink, CORE, STATE_CHANGE, (NULL), + ("Failed to start")); return GST_STATE_CHANGE_FAILURE; } activate_failed: diff --git a/libs/gst/base/gstbasesrc.c b/libs/gst/base/gstbasesrc.c index 35b7a2ee5f..934dcca1bb 100644 --- a/libs/gst/base/gstbasesrc.c +++ b/libs/gst/base/gstbasesrc.c @@ -3348,7 +3348,10 @@ was_started: could_not_start: { GST_DEBUG_OBJECT (basesrc, "could not start"); - /* subclass is supposed to post a message. We don't have to call _stop. */ + /* subclass is supposed to post a message but we post one as a fallback + * just in case. We don't have to call _stop. */ + GST_ELEMENT_ERROR (basesrc, CORE, STATE_CHANGE, (NULL), + ("Failed to start")); gst_base_src_start_complete (basesrc, GST_FLOW_ERROR); return FALSE; } |