aggregator: Don't automatically adjust segment if subclass provided one
authorSebastian Dröge <sebastian@centricular.com>
Thu, 20 Aug 2020 07:54:12 +0000 (10:54 +0300)
committerGStreamer Merge Bot <gitlab-merge-bot@gstreamer-foundation.org>
Mon, 24 Aug 2020 18:19:21 +0000 (18:19 +0000)
On the first buffer the base class would update the segment position
based on the start-time-selection. If the subclass provides its own
segment this will caused unexpected behaviour and override segment
information that was explicitly set by the subclass.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/600>

libs/gst/base/gstaggregator.c

index dc96852..d9cd3cb 100644 (file)
@@ -3611,6 +3611,9 @@ gst_aggregator_update_segment (GstAggregator * self, const GstSegment * segment)
   GST_OBJECT_LOCK (self);
   GST_AGGREGATOR_PAD (self->srcpad)->segment = *segment;
   self->priv->send_segment = TRUE;
+  /* we have a segment from the subclass now and really shouldn't override
+   * anything in that segment anymore, like the segment.position */
+  self->priv->first_buffer = FALSE;
   GST_OBJECT_UNLOCK (self);
 }