diff options
author | Sebastian Dröge <sebastian@centricular.com> | 2014-08-13 12:20:51 +0300 |
---|---|---|
committer | Sebastian Dröge <sebastian@centricular.com> | 2014-08-13 12:20:51 +0300 |
commit | ee662efdd17857e30c21fce32643226c586fe666 (patch) | |
tree | 4d813dd5d875ea80551776efac7b23899533661f /plugins/elements/gstqueue2.c | |
parent | 6a261b1fc28e4446f136131c686ff3530ba86ee5 (diff) |
queue2: Post errors if we receive EOS after downstream reported an error
There will be no further data flow that would allow us to propagate the
error upstream, causing nobody at all to post an error message.
Diffstat (limited to 'plugins/elements/gstqueue2.c')
-rw-r--r-- | plugins/elements/gstqueue2.c | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/plugins/elements/gstqueue2.c b/plugins/elements/gstqueue2.c index 144c684b9..63a56a30c 100644 --- a/plugins/elements/gstqueue2.c +++ b/plugins/elements/gstqueue2.c @@ -2286,6 +2286,25 @@ gst_queue2_handle_sink_event (GstPad * pad, GstObject * parent, if (GST_EVENT_IS_SERIALIZED (event)) { /* serialized events go in the queue */ GST_QUEUE2_MUTEX_LOCK_CHECK (queue, queue->sinkresult, out_flushing); + if (queue->srcresult != GST_FLOW_OK) { + /* Errors in sticky event pushing are no problem and ignored here + * as they will cause more meaningful errors during data flow. + * For EOS events, that are not followed by data flow, we still + * return FALSE here though and report an error. + */ + if (!GST_EVENT_IS_STICKY (event)) { + goto out_flow_error; + } else if (GST_EVENT_TYPE (event) == GST_EVENT_EOS) { + if (queue->srcresult == GST_FLOW_NOT_LINKED + || queue->srcresult < GST_FLOW_EOS) { + GST_ELEMENT_ERROR (queue, STREAM, FAILED, + (_("Internal data flow error.")), + ("streaming task paused, reason %s (%d)", + gst_flow_get_name (queue->srcresult), queue->srcresult)); + } + goto out_flow_error; + } + } /* refuse more events on EOS */ if (queue->is_eos) goto out_eos; @@ -2314,6 +2333,15 @@ out_eos: gst_event_unref (event); return FALSE; } +out_flow_error: + { + GST_LOG_OBJECT (queue, + "refusing event, we have a downstream flow error: %s", + gst_flow_get_name (queue->srcresult)); + GST_QUEUE2_MUTEX_UNLOCK (queue); + gst_event_unref (event); + return FALSE; + } } static gboolean |