mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-06-05 15:08:53 +00:00
queue: Do not hold GST_QUEUE_LOCK while posting ERROR messages
This might create deadlocks and we need to avoid holding element specific lock while posting messages For example a deadlock will happen if while posting the message, someone connected on the bus (sync) tries to DOT the pipeline. https://bugzilla.gnome.org/show_bug.cgi?id=737102
This commit is contained in:
parent
ecf479e3d1
commit
38657bff51
1 changed files with 2 additions and 1 deletions
|
@ -827,10 +827,12 @@ gst_queue_handle_sink_event (GstPad * pad, GstObject * parent, GstEvent * event)
|
||||||
* return FALSE here though and report an error.
|
* return FALSE here though and report an error.
|
||||||
*/
|
*/
|
||||||
if (!GST_EVENT_IS_STICKY (event)) {
|
if (!GST_EVENT_IS_STICKY (event)) {
|
||||||
|
GST_QUEUE_MUTEX_UNLOCK (queue);
|
||||||
goto out_flow_error;
|
goto out_flow_error;
|
||||||
} else if (GST_EVENT_TYPE (event) == GST_EVENT_EOS) {
|
} else if (GST_EVENT_TYPE (event) == GST_EVENT_EOS) {
|
||||||
if (queue->srcresult == GST_FLOW_NOT_LINKED
|
if (queue->srcresult == GST_FLOW_NOT_LINKED
|
||||||
|| queue->srcresult < GST_FLOW_EOS) {
|
|| queue->srcresult < GST_FLOW_EOS) {
|
||||||
|
GST_QUEUE_MUTEX_UNLOCK (queue);
|
||||||
GST_ELEMENT_ERROR (queue, STREAM, FAILED,
|
GST_ELEMENT_ERROR (queue, STREAM, FAILED,
|
||||||
(_("Internal data flow error.")),
|
(_("Internal data flow error.")),
|
||||||
("streaming task paused, reason %s (%d)",
|
("streaming task paused, reason %s (%d)",
|
||||||
|
@ -865,7 +867,6 @@ out_flow_error:
|
||||||
GST_CAT_LOG_OBJECT (queue_dataflow, queue,
|
GST_CAT_LOG_OBJECT (queue_dataflow, queue,
|
||||||
"refusing event, we have a downstream flow error: %s",
|
"refusing event, we have a downstream flow error: %s",
|
||||||
gst_flow_get_name (queue->srcresult));
|
gst_flow_get_name (queue->srcresult));
|
||||||
GST_QUEUE_MUTEX_UNLOCK (queue);
|
|
||||||
gst_event_unref (event);
|
gst_event_unref (event);
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue