From 6a261b1fc28e4446f136131c686ff3530ba86ee5 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Sebastian=20Dr=C3=B6ge?= Date: Wed, 13 Aug 2014 12:15:03 +0300 Subject: [PATCH] queue: Post errors when receiving EOS after downstream returned an error There might be no further data flow that would allow us to propagate the error upstream, causing nobody to post an error at all. --- plugins/elements/gstqueue.c | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/plugins/elements/gstqueue.c b/plugins/elements/gstqueue.c index 46e969f..30fcdc5 100644 --- a/plugins/elements/gstqueue.c +++ b/plugins/elements/gstqueue.c @@ -806,11 +806,20 @@ gst_queue_handle_sink_event (GstPad * pad, GstObject * parent, GstEvent * event) /* 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. + * return FALSE here though and report an error. */ - if (!GST_EVENT_IS_STICKY (event) || - GST_EVENT_TYPE (event) == GST_EVENT_EOS) + 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->eos) -- 2.7.4