Revert "aggregator: Start the task when linked"
authorNicolas Dufresne <nicolas.dufresne@collabora.com>
Wed, 25 May 2016 17:38:47 +0000 (13:38 -0400)
committerTim-Philipp Müller <tim@centricular.com>
Sat, 2 Dec 2017 15:10:26 +0000 (15:10 +0000)
This reverts commit 302580c3815136d29479c3a8cae611d6e2ff3709.

libs/gst/base/gstaggregator.c

index e057278..d458e97 100644 (file)
@@ -922,11 +922,9 @@ gst_aggregator_start_srcpad_task (GstAggregator * self)
 {
   GST_INFO_OBJECT (self, "Starting srcpad task");
 
-  if (gst_pad_is_active (self->srcpad)) {
-    self->priv->running = TRUE;
-    gst_pad_start_task (GST_PAD (self->srcpad),
-        (GstTaskFunction) gst_aggregator_aggregate_func, self, NULL);
-  }
+  self->priv->running = TRUE;
+  gst_pad_start_task (GST_PAD (self->srcpad),
+      (GstTaskFunction) gst_aggregator_aggregate_func, self, NULL);
 }
 
 static GstFlowReturn
@@ -1139,7 +1137,6 @@ gst_aggregator_default_sink_event (GstAggregator * self,
     }
     case GST_EVENT_STREAM_START:
     {
-      gst_aggregator_start_srcpad_task (self);
       goto eat;
     }
     case GST_EVENT_GAP:
@@ -1366,6 +1363,7 @@ gst_aggregator_request_new_pad (GstElement * element,
   GstAggregator *self;
   GstAggregatorPad *agg_pad;
   GstAggregatorClass *klass = GST_AGGREGATOR_GET_CLASS (element);
+  GstAggregatorPrivate *priv = GST_AGGREGATOR (element)->priv;
 
   self = GST_AGGREGATOR (element);
 
@@ -1378,7 +1376,7 @@ gst_aggregator_request_new_pad (GstElement * element,
   GST_DEBUG_OBJECT (element, "Adding pad %s", GST_PAD_NAME (agg_pad));
   self->priv->has_peer_latency = FALSE;
 
-  if (gst_pad_is_active (self->srcpad))
+  if (priv->running)
     gst_pad_set_active (GST_PAD (agg_pad), TRUE);
 
   /* add the pad to the element */
@@ -1787,6 +1785,7 @@ gst_aggregator_src_pad_activate_mode_func (GstPad * pad,
       case GST_PAD_MODE_PUSH:
       {
         GST_INFO_OBJECT (pad, "Activating pad!");
+        gst_aggregator_start_srcpad_task (self);
         return TRUE;
       }
       default: