From 513d897d6e7c38fdac063577d13fa20590e6c7ef Mon Sep 17 00:00:00 2001 From: Seungha Yang Date: Tue, 13 Jun 2023 21:53:29 +0900 Subject: [PATCH] aggregator: Resume srcpad task on stream-start only when running Race condition without this patch: - srcpad task is being stopped in gst_aggregator_stop_srcpad_task() - at that moment, in pre-queue event handler, gst_pad_get_task_state() returned GST_TASK_PAUSED - then in srcpad task got stopped in gst_aggregator_stop_srcpad_task() - finally srcpad task got resumed in pre-queue event handler To address it, checks "running" flag in pre-queue event handler. Both pre-queue stream-start event handler and "running" flag are protected by SRC_LOCK already. Part-of: --- subprojects/gstreamer/libs/gst/base/gstaggregator.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/subprojects/gstreamer/libs/gst/base/gstaggregator.c b/subprojects/gstreamer/libs/gst/base/gstaggregator.c index c0b71139d6..a6aa43af0c 100644 --- a/subprojects/gstreamer/libs/gst/base/gstaggregator.c +++ b/subprojects/gstreamer/libs/gst/base/gstaggregator.c @@ -1927,7 +1927,7 @@ gst_aggregator_default_sink_event_pre_queue (GstAggregator * self, SRC_LOCK (self); PAD_LOCK (aggpad); - if (event_type == GST_EVENT_STREAM_START) { + if (event_type == GST_EVENT_STREAM_START && priv->running) { GstTaskState task_state; aggpad->priv->flow_return = GST_FLOW_OK;