validate: Tear down pipeline when openning a new project
authorThibault Saunier <tsaunier@igalia.com>
Tue, 22 Oct 2019 09:53:36 +0000 (11:53 +0200)
committerThibault Saunier <tsaunier@igalia.com>
Tue, 22 Oct 2019 17:25:09 +0000 (19:25 +0200)
Avoiding potential deadlock when we remove tracks on a playing pipeline

ges/ges-validate.c

index 23b9e48..848f671 100644 (file)
@@ -758,6 +758,7 @@ _project_loaded_cb (GESProject * project, GESTimeline * timeline,
 static gboolean
 _load_project (GstValidateScenario * scenario, GstValidateAction * action)
 {
+  GstState state;
   GESProject *project;
   GList *tmp, *tmp_full;
 
@@ -780,6 +781,8 @@ _load_project (GstValidateScenario * scenario, GstValidateAction * action)
 
     goto fail;
   }
+  gst_element_get_state (pipeline, &state, NULL, 0);
+  gst_element_set_state (pipeline, GST_STATE_NULL);
 
   content = gst_structure_get_string (action->structure, "serialized-content");
   if (content) {
@@ -834,6 +837,8 @@ _load_project (GstValidateScenario * scenario, GstValidateAction * action)
     goto fail;
   }
 
+  gst_element_set_state (pipeline, state);
+
 done:
   if (error)
     g_error_free (error);