ges: Fix some error settings
authorThibault Saunier <tsaunier@gnome.org>
Thu, 14 May 2015 09:11:44 +0000 (11:11 +0200)
committerThibault Saunier <tsaunier@gnome.org>
Thu, 14 May 2015 13:31:52 +0000 (15:31 +0200)
Summary: Depends on D176

Reviewers: Mathieu_Du

Differential Revision: http://phabricator.freedesktop.org/D177

ges/ges-structured-interface.c
ges/ges-validate.c

index 35c1883..5228e3f 100644 (file)
@@ -232,6 +232,13 @@ _ges_get_asset_from_timeline (GESTimeline * timeline, GType type,
   if (err)
     g_propagate_error (error, err);
   if (!asset || (error && *error)) {
+
+    if (error && !*error) {
+      *error = g_error_new (GES_ERROR, 0,
+          "There was an error requesting the asset with id %s and type %s (%s)",
+          id, g_type_name (type), error ? (*error)->message : "unknown");
+    }
+
     GST_ERROR
         ("There was an error requesting the asset with id %s and type %s (%s)",
         id, g_type_name (type), error ? (*error)->message : "unknown");
@@ -356,7 +363,8 @@ _ges_add_clip_from_struct (GESTimeline * timeline, GstStructure * structure,
   }
 
   if (!layer) {
-    g_error_new (GES_ERROR, 0, "No layer with priority %d", layer_priority);
+    *error =
+        g_error_new (GES_ERROR, 0, "No layer with priority %d", layer_priority);
     goto beach;
   }
 
index f74a43e..e546748 100644 (file)
@@ -545,7 +545,10 @@ _validate_action_execute (GstValidateScenario * scenario,
 
   if (!func (timeline, action->structure, &err)) {
     GST_VALIDATE_REPORT (scenario,
-        g_quark_from_string ("scenario::execution-error"), err->message);
+        g_quark_from_string ("scenario::execution-error"),
+        "Could not execute %s (error: %s)",
+        gst_structure_get_name (action->structure),
+        err ? err->message : "None");
 
     g_clear_error (&err);