summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThibault Saunier <tsaunier@igalia.com>2020-06-18 12:46:39 -0400
committerThibault Saunier <tsaunier@igalia.com>2020-06-27 03:54:54 -0400
commit4c83b468d60bfc34c6bbfeb73001da4a29a28dd0 (patch)
treec6486f06844b31deb3fc9f5c64f478c3178cfa41
parentae3a45d1b6834eccd516873310194e88b180994e (diff)
validate: Always check if scenario is done from the right thread
Action will be set_done from the right thread and we will check if the action is done from there Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-devtools/-/merge_requests/212>
-rw-r--r--validate/gst/validate/gst-validate-scenario.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/validate/gst/validate/gst-validate-scenario.c b/validate/gst/validate/gst-validate-scenario.c
index 2b1db551b1..5c1196d708 100644
--- a/validate/gst/validate/gst-validate-scenario.c
+++ b/validate/gst/validate/gst-validate-scenario.c
@@ -2638,8 +2638,10 @@ execute_next_action_full (GstValidateScenario * scenario, GstMessage * message)
if (scenario->priv->actions)
act = scenario->priv->actions->data;
- if (!act)
+ if (!act) {
+ _check_scenario_is_done (scenario);
return G_SOURCE_CONTINUE;
+ }
switch (act->priv->state) {
case GST_VALIDATE_EXECUTE_ACTION_NONE:
@@ -4739,8 +4741,6 @@ _element_added_cb (GstBin * bin, GstElement * element,
SCENARIO_UNLOCK (scenario);
- _check_scenario_is_done (scenario);
-
/* If it's a bin, listen to the child */
if (GST_IS_BIN (element)) {
g_signal_connect (element, "element-added", (GCallback) _element_added_cb,
@@ -4820,14 +4820,16 @@ gst_validate_scenario_new (GstValidateRunner *
&scenario->priv->action_execution_interval)) {
GST_DEBUG_OBJECT (scenario, "Setting action execution interval to %d",
scenario->priv->action_execution_interval);
+ if (scenario->priv->action_execution_interval > 0)
+ scenario->priv->execute_on_idle = TRUE;
break;
} else if (gst_structure_get_int (config->data,
"scenario-action-execution-interval", &interval)) {
if (interval > 0) {
scenario->priv->action_execution_interval = (guint) interval;
+ scenario->priv->execute_on_idle = TRUE;
GST_DEBUG_OBJECT (scenario, "Setting action execution interval to %d",
scenario->priv->action_execution_interval);
-
break;
} else {
GST_WARNING_OBJECT (scenario, "Interval is negative: %d", interval);