From f94c7ae3c99e0febfb81c9710bb0b98922eaf5f8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Thu, 9 Jul 2020 12:45:27 +0300 Subject: [PATCH] audioaggregator: Fix negotiation with downstream if there is no peer yet get_allowed_caps() will return NULL, which is not a problem in itself. Just take the template caps for negotiation in that case instead of erroring out. Part-of: --- gst-libs/gst/audio/gstaudioaggregator.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/gst-libs/gst/audio/gstaudioaggregator.c b/gst-libs/gst/audio/gstaudioaggregator.c index f83c61713c..1d45170d50 100644 --- a/gst-libs/gst/audio/gstaudioaggregator.c +++ b/gst-libs/gst/audio/gstaudioaggregator.c @@ -875,7 +875,11 @@ gst_audio_aggregator_sink_setcaps (GstAudioAggregatorPad * aaggpad, gint downstream_rate; GstStructure *s; - if (!downstream_caps || gst_caps_is_empty (downstream_caps)) { + /* Returns NULL if there is no downstream peer */ + if (!downstream_caps) + downstream_caps = gst_pad_get_pad_template_caps (agg->srcpad); + + if (gst_caps_is_empty (downstream_caps)) { ret = FALSE; goto done; }