Commit 64bb85e6 authored by Thibault Saunier's avatar Thibault Saunier 🌵
Browse files

ges: Fix setting GError when adding children to containers

We were misusing assertion and not properly setting the GError value
parent d58d9926
......@@ -552,7 +552,14 @@ _ges_container_add_child_from_struct (GESTimeline * timeline,
GES_CONTAINER (ges_timeline_get_element (timeline, container_name));
}
g_return_val_if_fail (GES_IS_CONTAINER (container), FALSE);
if (!GES_IS_CONTAINER (container)) {
*error =
g_error_new (GES_ERROR, 0, "Could not find container: %s (%p)",
container_name, container);
res = FALSE;
goto beach;
}
id = gst_structure_get_string (structure, "asset-id");
child_type = gst_structure_get_string (structure, "child-type");
......@@ -569,7 +576,7 @@ _ges_container_add_child_from_struct (GESTimeline * timeline,
child = GES_TIMELINE_ELEMENT (ges_asset_extract (asset, NULL));
if (!GES_IS_TIMELINE_ELEMENT (child)) {
g_error_new (GES_ERROR, 0, "Could not extract child element");
*error = g_error_new (GES_ERROR, 0, "Could not extract child element");
goto beach;
}
......@@ -579,14 +586,15 @@ _ges_container_add_child_from_struct (GESTimeline * timeline,
if (!child && child_name) {
child = ges_timeline_get_element (timeline, child_name);
if (!GES_IS_TIMELINE_ELEMENT (child)) {
g_error_new (GES_ERROR, 0, "Could not find child element");
*error = g_error_new (GES_ERROR, 0, "Could not find child element");
goto beach;
}
}
if (!child) {
g_error_new (GES_ERROR, 0, "Wrong parameters, could not get a child");
*error =
g_error_new (GES_ERROR, 0, "Wrong parameters, could not get a child");
return FALSE;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment