From 35b6bfb7c8cfaa7bdf3d7462b26835f0165307ae Mon Sep 17 00:00:00 2001 From: Thibault Saunier Date: Wed, 23 Jul 2014 14:51:43 +0200 Subject: [PATCH] validate:scenario: Properly check that remaining actions are not 'ending' ones When checking that all action were executed, we need to make sure that actions such as EOS or stop are not taken into account as we might have shorter medias than the duration of the scenario, and that should not be fatal. + Plug a leak on the way --- validate/gst/validate/gst-validate-scenario.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/validate/gst/validate/gst-validate-scenario.c b/validate/gst/validate/gst-validate-scenario.c index b9dd381d48..88dfa03294 100644 --- a/validate/gst/validate/gst-validate-scenario.c +++ b/validate/gst/validate/gst-validate-scenario.c @@ -1073,15 +1073,20 @@ message_cb (GstBus * bus, GstMessage * message, GstValidateScenario * scenario) for (tmp = scenario->priv->actions; tmp; tmp = tmp->next) { GstValidateAction *action = ((GstValidateAction *) tmp->data); + gchar *action_string; tmpconcat = actions; - if (g_strcmp0 (action->name, "eos")) + action_string = gst_structure_to_string (action->structure); + if (g_regex_match_simple ("eos|stop", action_string, 0, 0)) { + g_free (action_string); continue; + } nb_actions++; - actions = g_strdup_printf ("%s\n%*s%s", - actions, 20, "", gst_structure_to_string (action->structure)); + actions = + g_strdup_printf ("%s\n%*s%s", actions, 20, "", action_string); g_free (tmpconcat); + g_free (action_string); }