From 1208d4e635f33152fae0903790b2fe4a9172cb57 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Sebastian=20Dr=C3=B6ge?= Date: Thu, 20 Aug 2020 16:31:38 +0300 Subject: [PATCH] audioaggregator: Reset offset if the output rate is renegotiated On next aggregation the new offset will be calculated based on the segment position. Without this a rate change would cause a jump forwards or backwards in the output timeline. Part-of: --- gst-libs/gst/audio/gstaudioaggregator.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/gst-libs/gst/audio/gstaudioaggregator.c b/gst-libs/gst/audio/gstaudioaggregator.c index f9acc6d..ac8ee8c 100644 --- a/gst-libs/gst/audio/gstaudioaggregator.c +++ b/gst-libs/gst/audio/gstaudioaggregator.c @@ -1099,6 +1099,9 @@ gst_audio_aggregator_negotiated_src_caps (GstAggregator * agg, GstCaps * caps) GST_INFO_OBJECT (aagg, "setting caps to %" GST_PTR_FORMAT, caps); gst_caps_replace (&aagg->current_caps, caps); + if (old_info.rate != info.rate) + aagg->priv->offset = -1; + memcpy (&srcpad->info, &info, sizeof (info)); gst_audio_aggregator_update_converters (aagg, &info, &old_info); -- 2.7.4