mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-27 04:01:08 +00:00
queue2: Hold the lock when modifying sinkresult
As it's done elsewhere. Avoids a potential race of the field being modified in the meantime. Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3110>
This commit is contained in:
parent
f2a1769236
commit
f08bdf1c4a
1 changed files with 3 additions and 1 deletions
|
@ -2675,12 +2675,14 @@ gst_queue2_handle_sink_event (GstPad * pad, GstObject * parent,
|
||||||
|
|
||||||
/* STREAM_START and SEGMENT reset the EOS status of a
|
/* STREAM_START and SEGMENT reset the EOS status of a
|
||||||
* pad. Change the cached sinkpad flow result accordingly */
|
* pad. Change the cached sinkpad flow result accordingly */
|
||||||
|
GST_QUEUE2_MUTEX_LOCK (queue);
|
||||||
if (queue->sinkresult == GST_FLOW_EOS
|
if (queue->sinkresult == GST_FLOW_EOS
|
||||||
&& (GST_EVENT_TYPE (event) == GST_EVENT_STREAM_START
|
&& (GST_EVENT_TYPE (event) == GST_EVENT_STREAM_START
|
||||||
|| GST_EVENT_TYPE (event) == GST_EVENT_SEGMENT))
|
|| GST_EVENT_TYPE (event) == GST_EVENT_SEGMENT))
|
||||||
queue->sinkresult = GST_FLOW_OK;
|
queue->sinkresult = GST_FLOW_OK;
|
||||||
|
else if (queue->sinkresult != GST_FLOW_OK)
|
||||||
|
goto out_flushing;
|
||||||
|
|
||||||
GST_QUEUE2_MUTEX_LOCK_CHECK (queue, queue->sinkresult, out_flushing);
|
|
||||||
if (queue->srcresult != GST_FLOW_OK) {
|
if (queue->srcresult != GST_FLOW_OK) {
|
||||||
/* Errors in sticky event pushing are no problem and ignored here
|
/* Errors in sticky event pushing are no problem and ignored here
|
||||||
* as they will cause more meaningful errors during data flow.
|
* as they will cause more meaningful errors during data flow.
|
||||||
|
|
Loading…
Reference in a new issue