From 5d995382f866ea5c6b0f41bbebb1d8487e4b1dfd Mon Sep 17 00:00:00 2001 From: Jakub Adam Date: Mon, 14 Oct 2024 22:08:19 +0200 Subject: [PATCH] aggregator: Fix handling NEED_DATA return from update_src_caps() Since GST_AGGREGATOR_FLOW_NEED_DATA == GST_FLOW_CUSTOM_ERROR == -100, in order to print the right debug message, we have to check that condition first before comparing ret with GST_FLOW_OK. Part-of: --- subprojects/gstreamer/libs/gst/base/gstaggregator.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/subprojects/gstreamer/libs/gst/base/gstaggregator.c b/subprojects/gstreamer/libs/gst/base/gstaggregator.c index 606585c260..1f1c7c2094 100644 --- a/subprojects/gstreamer/libs/gst/base/gstaggregator.c +++ b/subprojects/gstreamer/libs/gst/base/gstaggregator.c @@ -1290,12 +1290,12 @@ gst_aggregator_default_negotiate (GstAggregator * self) GST_DEBUG_OBJECT (self, "updating caps from %" GST_PTR_FORMAT, downstream_caps); ret = agg_klass->update_src_caps (self, downstream_caps, &caps); - if (ret < GST_FLOW_OK) { - GST_WARNING_OBJECT (self, "Subclass failed to update provided caps"); - goto done; - } else if (ret == GST_AGGREGATOR_FLOW_NEED_DATA) { + if (ret == GST_AGGREGATOR_FLOW_NEED_DATA) { GST_DEBUG_OBJECT (self, "Subclass needs more data to decide on caps"); goto done; + } else if (ret < GST_FLOW_OK) { + GST_WARNING_OBJECT (self, "Subclass failed to update provided caps"); + goto done; } if ((caps == NULL || gst_caps_is_empty (caps)) && ret >= GST_FLOW_OK) { ret = GST_FLOW_NOT_NEGOTIATED;