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: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7663>
This commit is contained in:
Jakub Adam 2024-10-14 22:08:19 +02:00 committed by GStreamer Marge Bot
parent f77628a598
commit 5d995382f8

View file

@ -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;