From 2dbe0776196ce7741d6fbc989040d68f41634cff Mon Sep 17 00:00:00 2001 From: Thibault Saunier Date: Wed, 2 Oct 2024 14:16:11 -0300 Subject: [PATCH] ges: Fix reloading timeline from project Part-of: --- subprojects/gst-editing-services/ges/ges-project.c | 10 ++++++++-- subprojects/gst-editing-services/ges/ges-timeline.c | 1 + 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/subprojects/gst-editing-services/ges/ges-project.c b/subprojects/gst-editing-services/ges/ges-project.c index 477fb9de74..49b4849890 100644 --- a/subprojects/gst-editing-services/ges/ges-project.c +++ b/subprojects/gst-editing-services/ges/ges-project.c @@ -1293,11 +1293,17 @@ ges_project_load (GESProject * project, GESTimeline * timeline, GError ** error) g_return_val_if_fail (project->priv->uri, FALSE); g_return_val_if_fail (timeline->tracks == NULL, FALSE); - if (!_load_project (project, timeline, error)) - return FALSE; + GESProject *previous = gst_object_ref (ges_timeline_get_project (timeline)); ges_extractable_set_asset (GES_EXTRACTABLE (timeline), GES_ASSET (project)); + if (!_load_project (project, timeline, error)) { + ges_extractable_set_asset (GES_EXTRACTABLE (timeline), + GES_ASSET (previous)); + gst_object_unref (previous); + return FALSE; + } + gst_object_unref (previous); return TRUE; } diff --git a/subprojects/gst-editing-services/ges/ges-timeline.c b/subprojects/gst-editing-services/ges/ges-timeline.c index 6431c37ed7..a480e53633 100644 --- a/subprojects/gst-editing-services/ges/ges-timeline.c +++ b/subprojects/gst-editing-services/ges/ges-timeline.c @@ -330,6 +330,7 @@ ges_extractable_interface_init (GESExtractableInterface * iface) iface->asset_type = GES_TYPE_PROJECT; iface->check_id = (GESExtractableCheckId) extractable_check_id; iface->get_id = extractable_get_id; + iface->can_update_asset = TRUE; } static void