summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastian Dröge <sebastian@centricular.com>2019-08-14 09:51:55 +0300
committerTim-Philipp Müller <tim@centricular.com>2019-08-14 14:49:53 +0100
commit549cc941eb815a4116dc6e9e8806e3029a2ae869 (patch)
treea30ea433fc9dee92ad808ef24adf10bfc7ac0e2e
parent5bf13cdd5314bc3c6c81bd620e712acdcab14eb2 (diff)
aggregator: Actually handle NEED_DATA return from update_src_caps()
The documentation says that this allows the subclass to signal that it needs more data before it can decide on caps, so let's actually implement it that way.
-rw-r--r--libs/gst/base/gstaggregator.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/libs/gst/base/gstaggregator.c b/libs/gst/base/gstaggregator.c
index 94d481604..5cdb852dc 100644
--- a/libs/gst/base/gstaggregator.c
+++ b/libs/gst/base/gstaggregator.c
@@ -1032,6 +1032,9 @@ gst_aggregator_update_src_caps (GstAggregator * self)
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) {
+ GST_DEBUG_OBJECT (self, "Subclass needs more data to decide on caps");
+ goto done;
}
if ((caps == NULL || gst_caps_is_empty (caps)) && ret >= GST_FLOW_OK) {
ret = GST_FLOW_NOT_NEGOTIATED;
@@ -1145,6 +1148,8 @@ gst_aggregator_aggregate_func (GstAggregator * self)
flow_return = gst_aggregator_update_src_caps (self);
if (flow_return != GST_FLOW_OK)
gst_pad_mark_reconfigure (GST_AGGREGATOR_SRC_PAD (self));
+ if (flow_return == GST_AGGREGATOR_FLOW_NEED_DATA)
+ flow_return = GST_FLOW_OK;
}
if (timeout || flow_return >= GST_FLOW_OK) {