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.
This commit is contained in:
Sebastian Dröge 2016-05-14 17:31:51 +03:00
parent 174a5e93e2
commit d184e7a9a0
2 changed files with 8 additions and 1 deletions

View file

@ -5237,6 +5237,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:

View file

@ -3347,7 +3347,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;
}