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.
This commit is contained in:
Thibault Saunier 2019-03-26 10:47:12 -03:00 committed by Thibault Saunier
parent d8aaf5fdaa
commit dcfa084fae
2 changed files with 13 additions and 3 deletions

View file

@ -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) {

View file

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