diff --git a/validate/gst/validate/gst-validate-pad-monitor.c b/validate/gst/validate/gst-validate-pad-monitor.c index 2f5ff21963..c3c157b89f 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 943e7e32d6..83083ddf7a 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);