summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThibault Saunier <tsaunier@igalia.com>2019-03-26 10:47:12 -0300
committerThibault Saunier <tsaunier@gnome.org>2019-04-03 13:38:42 +0000
commitdcfa084fae533a9010d825c992320a12877f30e0 (patch)
treea974df511fd2b2824c12a429674d439c955ca25e
parentd8aaf5fdaa80a407f8174a2d94034ffc621da7e2 (diff)
validate:pad-monitor: Accept any return value when we aggregated FLUSHING while tearing down
Basically nothing guarantees that the set of pads we aggregated the flow for is the same as the one that was aggregated during the actual data flow as some pads could have been removed meanwhile.
-rw-r--r--validate/gst/validate/gst-validate-pad-monitor.c14
-rw-r--r--validate/tests/check/validate/padmonitor.c2
2 files changed, 13 insertions, 3 deletions
diff --git a/validate/gst/validate/gst-validate-pad-monitor.c b/validate/gst/validate/gst-validate-pad-monitor.c
index 2f5ff21..c3c157b 100644
--- a/validate/gst/validate/gst-validate-pad-monitor.c
+++ b/validate/gst/validate/gst-validate-pad-monitor.c
@@ -1338,6 +1338,7 @@ gst_validate_pad_monitor_check_aggregated_return (GstValidatePadMonitor *
gboolean done;
GstPad *otherpad;
GstPad *peerpad;
+ GstState state, pending;
GstValidatePadMonitor *othermonitor;
GstFlowReturn aggregated = GST_FLOW_NOT_LINKED;
gboolean found_a_pad = FALSE;
@@ -1384,8 +1385,17 @@ gst_validate_pad_monitor_check_aggregated_return (GstValidatePadMonitor *
/* no peer pad found, nothing to do */
goto done;
}
- if (aggregated == GST_FLOW_OK || aggregated == GST_FLOW_EOS) {
- GstState state, pending;
+
+ if (aggregated == GST_FLOW_FLUSHING) {
+ gst_element_get_state (GST_ELEMENT (parent), &state, &pending, 0);
+ if (state < GST_STATE_PAUSED || pending < GST_STATE_PAUSED) {
+ /* Aggregated is flushing, we might have been aggregating a combination
+ * of pads that are not what was present on the element during the actual
+ * data flow combination (pads might have been removed meanwhile) */
+
+ goto done;
+ }
+ } else if (aggregated == GST_FLOW_OK || aggregated == GST_FLOW_EOS) {
/* those are acceptable situations */
if (GST_PAD_IS_FLUSHING (pad) && ret == GST_FLOW_FLUSHING) {
diff --git a/validate/tests/check/validate/padmonitor.c b/validate/tests/check/validate/padmonitor.c
index 943e7e3..83083dd 100644
--- a/validate/tests/check/validate/padmonitor.c
+++ b/validate/tests/check/validate/padmonitor.c
@@ -378,9 +378,9 @@ GST_START_TEST(flow_aggregation_##name) { \
FLOW_TEST (ok_ok_error_ok, OK, OK, ERROR, OK, TRUE);
FLOW_TEST (eos_eos_eos_ok, EOS, EOS, EOS, OK, TRUE);
-FLOW_TEST (flushing_ok_ok_ok, FLUSHING, OK, OK, OK, TRUE);
FLOW_TEST (not_neg_ok_ok_ok, NOT_NEGOTIATED, OK, OK, OK, TRUE);
/*[> Passing cases: <]*/
+FLOW_TEST (flushing_ok_ok_ok, FLUSHING, OK, OK, OK, FALSE);
FLOW_TEST (eos_eos_eos_eos, EOS, EOS, EOS, EOS, FALSE);
FLOW_TEST (eos_eos_ok_ok, EOS, EOS, OK, OK, FALSE);
FLOW_TEST (ok_ok_ok_eos, OK, OK, OK, EOS, FALSE);