aggregator: Initialize source pad segment position to -1 when resetting
authorSebastian Dröge <sebastian@centricular.com>
Thu, 23 Jan 2020 17:27:14 +0000 (19:27 +0200)
committerSebastian Dröge <sebastian@centricular.com>
Thu, 23 Jan 2020 17:27:14 +0000 (19:27 +0200)
This allows start-time selection in gst_aggregator_pad_chain_internal()
to actually work as that code assumes it to be -1 for actually
overriding the value.

Fixes https://gitlab.freedesktop.org/gstreamer/gstreamer/issues/500

libs/gst/base/gstaggregator.c

index fb2100b..b22a5f7 100644 (file)
@@ -519,6 +519,9 @@ gst_aggregator_reset_flow_values (GstAggregator * self)
   self->priv->send_segment = TRUE;
   gst_segment_init (&GST_AGGREGATOR_PAD (self->srcpad)->segment,
       GST_FORMAT_TIME);
+  /* Initialize to -1 so we set it to the start position once the first buffer
+   * is handled in gst_aggregator_pad_chain_internal() */
+  GST_AGGREGATOR_PAD (self->srcpad)->segment.position = -1;
   self->priv->first_buffer = TRUE;
   GST_OBJECT_UNLOCK (self);
 }