From f9d1641848e0393ee8c22966ed97e652d97bee19 Mon Sep 17 00:00:00 2001 From: Mathieu Duponchelle Date: Thu, 23 Dec 2021 00:24:03 +0100 Subject: [PATCH] aggregator: don't forward reconfigure events Those will cause us to renegotiate at the next aggregate cycle, and while at that point we may decide to reconfigure upstream branches (in practice we don't as this is inherently racy, and that's the reason why mixer subclasses perform conversion internally), we certainly don't want to just forward the event willy-nilly to all our sinkpads. An actual issue this is fixing is when caps downstream of a compositor are changed at every samples-selected signal emission, for the purpose of interpolating the output geometry, and the compositor has a non-zero latency, the reconfigure events were forwarded to basesrc, which triggered an allocation query, which in turn caused aggregator to have to drain (thus not being able to queue frames), leading to disastrous effects (choppy output as compositor couldn't consume frames fast enough, the higher the latency the choppier the output) Part-of: --- subprojects/gstreamer/libs/gst/base/gstaggregator.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/subprojects/gstreamer/libs/gst/base/gstaggregator.c b/subprojects/gstreamer/libs/gst/base/gstaggregator.c index b24ef483bc..d6c91cd167 100644 --- a/subprojects/gstreamer/libs/gst/base/gstaggregator.c +++ b/subprojects/gstreamer/libs/gst/base/gstaggregator.c @@ -2415,6 +2415,11 @@ gst_aggregator_default_src_event (GstAggregator * self, GstEvent * event) /* navigation is rather pointless. */ gst_event_unref (event); return FALSE; + case GST_EVENT_RECONFIGURE: + /* We will renegotiate with downstream, we don't + * need to forward this further */ + gst_event_unref (event); + return TRUE; default: break; }