validate:scenario: Do not execute last sub action twice when ASYNC

This commit is contained in:
Thibault Saunier 2015-03-03 11:33:06 +01:00
parent 7888293f8f
commit 34394b0c7a
2 changed files with 12 additions and 0 deletions

View file

@ -511,6 +511,9 @@ _append_value (GQuark field_id, const GValue * value, GString * string)
{
gchar *val_str = NULL;
if (g_strcmp0 (g_quark_to_string (field_id), "sub-action") == 0)
return TRUE;
if (G_VALUE_TYPE (value) == GST_TYPE_CLOCK_TIME)
val_str = g_strdup_printf ("%" GST_TIME_FORMAT,
GST_TIME_ARGS (g_value_get_uint64 (value)));

View file

@ -173,6 +173,7 @@ struct _GstValidateActionPrivate
GstStructure *main_structure;
GstValidateExecuteActionReturn state; /* Actually ActionState */
gboolean printed;
gboolean executing_last_subaction;
};
GST_DEFINE_MINI_OBJECT_TYPE (GstValidateAction, gst_validate_action);
@ -1005,6 +1006,9 @@ gst_validate_execute_action (GstValidateActionType * action_type,
action->priv->printed = FALSE;
action->structure = gst_structure_copy (action->priv->main_structure);
if (res == GST_VALIDATE_EXECUTE_ACTION_ASYNC)
action->priv->executing_last_subaction = TRUE;
}
return res;
@ -2316,6 +2320,11 @@ _execute_sub_action_action (GstValidateAction * action)
const gchar *subaction_str;
GstStructure *subaction_struct = NULL;
if (action->priv->executing_last_subaction) {
action->priv->executing_last_subaction = FALSE;
return GST_VALIDATE_EXECUTE_ACTION_OK;
}
subaction_str = gst_structure_get_string (action->structure, "sub-action");
if (subaction_str) {
subaction_struct = gst_structure_from_string (subaction_str, NULL);