From c0a0c1f582494fe514ed5aae00911a4724652569 Mon Sep 17 00:00:00 2001 From: Thibault Saunier Date: Fri, 26 Sep 2014 17:50:03 +0200 Subject: [PATCH] ges-validate: Fix edit_container return code It used to always return FALSE. + Fix minor leaks + Do not seek ourself, it is users responsability to seek and commit these days. --- tools/ges-validate.c | 32 +++++++++++++------------------- 1 file changed, 13 insertions(+), 19 deletions(-) diff --git a/tools/ges-validate.c b/tools/ges-validate.c index cb0f620f38..7a9ed29d86 100644 --- a/tools/ges-validate.c +++ b/tools/ges-validate.c @@ -210,8 +210,11 @@ _add_asset (GstValidateScenario * scenario, GstValidateAction * action) asset = _get_asset (type, id); - if (!asset) - return FALSE; + if (!asset) { + res = FALSE; + + goto beach; + } res = ges_project_add_asset (project, asset); @@ -370,8 +373,11 @@ _add_clip (GstValidateScenario * scenario, GstValidateAction * action) } asset = _get_asset (type, asset_id); - if (!asset) - return FALSE; + if (!asset) { + res = FALSE; + + goto beach; + } layer = _get_layer_by_priority (timeline, layer_priority); @@ -408,10 +414,8 @@ beach: static gboolean _edit_container (GstValidateScenario * scenario, GstValidateAction * action) { - gint64 cpos; GList *layers = NULL; GESTimeline *timeline; - GstQuery *query_segment; GESTimelineElement *container; GstClockTime position; gboolean res = FALSE; @@ -456,24 +460,14 @@ _edit_container (GstValidateScenario * scenario, GstValidateAction * action) edit_mode_str ? edit_mode_str : "normal", edge_str ? edge_str : "None", new_layer_priority); - if (!ges_container_edit (GES_CONTAINER (container), layers, - new_layer_priority, mode, edge, position)) { + if (!(res = ges_container_edit (GES_CONTAINER (container), layers, + new_layer_priority, mode, edge, position))) { gst_object_unref (container); + GST_ERROR ("HERE"); goto beach; } gst_object_unref (container); - query_segment = gst_query_new_segment (GST_FORMAT_TIME); - if (!gst_element_query (scenario->pipeline, query_segment)) { - GST_ERROR_OBJECT (scenario, "Could not query segment"); - goto beach; - } - - if (!gst_element_query_position (scenario->pipeline, GST_FORMAT_TIME, &cpos)) { - GST_ERROR_OBJECT (scenario, "Could not query position"); - goto beach; - } - beach: g_object_unref (timeline); return res;