mpegtsbase: Error out on EOS without any pad

Avoids ending up with hanging pipelines
This commit is contained in:
Edward Hervey 2012-03-01 17:59:57 +01:00
parent a4899af8d6
commit 77ece06a3f

View file

@ -1439,9 +1439,16 @@ error:
{
const gchar *reason = gst_flow_get_name (ret);
GST_DEBUG_OBJECT (base, "Pausing task, reason %s", reason);
if (ret == GST_FLOW_UNEXPECTED)
GST_MPEGTS_BASE_GET_CLASS (base)->push_event (base, gst_event_new_eos ());
else if (ret == GST_FLOW_NOT_LINKED || ret < GST_FLOW_UNEXPECTED) {
if (ret == GST_FLOW_UNEXPECTED) {
/* Push EOS downstream */
if (!GST_MPEGTS_BASE_GET_CLASS (base)->push_event (base,
gst_event_new_eos ())) {
/* If that failed, emit an error so the pipeline can be stopped */
GST_ELEMENT_ERROR (base, STREAM, DEMUX, (NULL),
("got eos but no streams (yet)"));
}
} else if (ret == GST_FLOW_NOT_LINKED || ret < GST_FLOW_UNEXPECTED) {
GST_ELEMENT_ERROR (base, STREAM, FAILED,
(_("Internal data stream error.")),
("stream stopped, reason %s", reason));