summaryrefslogtreecommitdiff
path: root/gst-libs/gst
diff options
context:
space:
mode:
Diffstat (limited to 'gst-libs/gst')
-rw-r--r--gst-libs/gst/base/gstaggregator.c11
1 files changed, 3 insertions, 8 deletions
diff --git a/gst-libs/gst/base/gstaggregator.c b/gst-libs/gst/base/gstaggregator.c
index 7e8c5be44..d693541ea 100644
--- a/gst-libs/gst/base/gstaggregator.c
+++ b/gst-libs/gst/base/gstaggregator.c
@@ -2351,17 +2351,12 @@ gst_aggregator_pad_event_func (GstPad * pad, GstObject * parent,
}
if (event) {
+ gboolean is_caps = (GST_EVENT_TYPE (event) == GST_EVENT_CAPS);
+
if (!klass->sink_event (self, aggpad, event)) {
/* Copied from GstPad to convert boolean to a GstFlowReturn in
* the event handling func */
- switch (GST_EVENT_TYPE (event)) {
- case GST_EVENT_CAPS:
- ret = GST_FLOW_NOT_NEGOTIATED;
- break;
- default:
- ret = GST_FLOW_ERROR;
- break;
- }
+ ret = is_caps ? GST_FLOW_NOT_NEGOTIATED : GST_FLOW_ERROR;
}
}