summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThibault Saunier <thibault.saunier@collabora.com>2014-02-19 09:56:12 +0100
committerThibault Saunier <thibault.saunier@collabora.com>2014-02-19 14:32:47 +0100
commit5e0e092112b906854b04c06fc13fec2ab6fdf87b (patch)
tree7791f817ccb45c6c208b21da37272da7f2a07566
parent2f44d15e0b58db0eeac972385c3b186f160b4b9e (diff)
validate: Add actions to the actions list only when they are fully parsed
Otherwize in some corner cases they can be executed before they are actually parsed
-rw-r--r--validate/gst/validate/gst-validate-scenario.c19
1 files changed, 17 insertions, 2 deletions
diff --git a/validate/gst/validate/gst-validate-scenario.c b/validate/gst/validate/gst-validate-scenario.c
index 8707b6f..967b5ae 100644
--- a/validate/gst/validate/gst-validate-scenario.c
+++ b/validate/gst/validate/gst-validate-scenario.c
@@ -676,6 +676,17 @@ gst_validate_scenario_update_segment_from_seek (GstValidateScenario * scenario,
}
}
+static gint
+_compare_actions (GstValidateAction *a, GstValidateAction * b)
+{
+ if (a->action_number < b->action_number)
+ return -1;
+ else if (a->action_number == b->action_number)
+ return 0;
+
+ return 1;
+}
+
static gboolean
message_cb (GstBus * bus, GstMessage * message, GstValidateScenario * scenario)
{
@@ -704,6 +715,9 @@ message_cb (GstBus * bus, GstMessage * message, GstValidateScenario * scenario)
return FALSE;
}
+
+ priv->actions = g_list_insert_sorted (priv->actions, action,
+ (GCompareFunc) _compare_actions);
}
g_list_free (priv->needs_parsing);
@@ -909,7 +923,7 @@ _load_scenario_file (GstValidateScenario * scenario,
gdouble playback_time;
GstValidateAction *action;
GstValidateActionType *action_type;
- const gchar *type, *str_playback_time;
+ const gchar *type, *str_playback_time = NULL;
GstStructure *structure = tmp->data;
@@ -951,7 +965,8 @@ _load_scenario_file (GstValidateScenario * scenario,
}
action->action_number = priv->num_actions++;
- priv->actions = g_list_append (priv->actions, action);
+ if (str_playback_time == NULL)
+ priv->actions = g_list_append (priv->actions, action);
}
done: