summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastian Dröge <sebastian@centricular.com>2020-07-09 12:45:27 +0300
committerGStreamer Merge Bot <gitlab-merge-bot@gstreamer-foundation.org>2020-09-25 06:02:49 +0000
commit836cf3611c64c2325e315b52295bd94880a51aeb (patch)
treeb885187747ed2f6155e18a03701f31a58489d7f2
parent1390b20c948bb582011ff7467fc8d8fb0c502da5 (diff)
downloadgstreamer-plugins-base-836cf3611c64c2325e315b52295bd94880a51aeb.tar.gz
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: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/830>
-rw-r--r--gst-libs/gst/audio/gstaudioaggregator.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/gst-libs/gst/audio/gstaudioaggregator.c b/gst-libs/gst/audio/gstaudioaggregator.c
index 0e6db73a1..16e76b649 100644
--- a/gst-libs/gst/audio/gstaudioaggregator.c
+++ b/gst-libs/gst/audio/gstaudioaggregator.c
@@ -761,7 +761,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;
}