diff options
author | Mark Nauwelaerts <mark.nauwelaerts@collabora.co.uk> | 2009-08-06 13:29:29 +0200 |
---|---|---|
committer | Mark Nauwelaerts <mark.nauwelaerts@collabora.co.uk> | 2009-08-06 13:42:25 +0200 |
commit | 3352c5d97042b21850439df2ca475c46c39a164b (patch) | |
tree | 09840143aab4a05bf0c8ce4021ec38e9b6de3210 /plugins | |
parent | 3f0e4bd6f69067907bed6d3b07f41bb64b9c146f (diff) |
queue: post error message when pausing task
If downstream returns error and upstream has already delivered
everything (including EOS) and will no longer be around to find
out that we paused (and why), post error message. Fixes #589991.
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/elements/gstqueue.c | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/plugins/elements/gstqueue.c b/plugins/elements/gstqueue.c index 20380afab2..4200605afd 100644 --- a/plugins/elements/gstqueue.c +++ b/plugins/elements/gstqueue.c @@ -1159,11 +1159,24 @@ gst_queue_loop (GstPad * pad) /* ERRORS */ out_flushing: { + gboolean eos = queue->eos; + GstFlowReturn ret = queue->srcresult; + gst_pad_pause_task (queue->srcpad); GST_CAT_LOG_OBJECT (queue_dataflow, queue, - "pause task, reason: %s", gst_flow_get_name (queue->srcresult)); + "pause task, reason: %s", gst_flow_get_name (ret)); GST_QUEUE_SIGNAL_DEL (queue); GST_QUEUE_MUTEX_UNLOCK (queue); + /* let app know about us giving up if upstream is not expected to do so */ + /* UNEXPECTED is already taken care of elsewhere */ + if (eos && (GST_FLOW_IS_FATAL (ret) || ret == GST_FLOW_NOT_LINKED) && + (ret != GST_FLOW_UNEXPECTED)) { + GST_ELEMENT_ERROR (queue, STREAM, FAILED, + (_("Internal data flow error.")), + ("streaming task paused, reason %s (%d)", + gst_flow_get_name (ret), ret)); + gst_pad_push_event (queue->srcpad, gst_event_new_eos ()); + } return; } } |