mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-23 10:11:08 +00:00
timeline: fix paste ownership
The method steals ownership of `copied_from`, so should be responsible for unreffing it. Also make sure we fail when `layer != -1`, since this functionality is not supported.
This commit is contained in:
parent
8ad9952cdb
commit
615bf9e47a
1 changed files with 6 additions and 3 deletions
|
@ -2779,6 +2779,7 @@ ges_timeline_paste_element (GESTimeline * timeline,
|
|||
CHECK_THREAD (timeline);
|
||||
|
||||
element_class = GES_TIMELINE_ELEMENT_GET_CLASS (element);
|
||||
/* steal ownership of the copied element */
|
||||
copied_from = ges_timeline_element_get_copied_from (element);
|
||||
|
||||
if (!copied_from) {
|
||||
|
@ -2789,7 +2790,7 @@ ges_timeline_paste_element (GESTimeline * timeline,
|
|||
|
||||
if (!element_class->paste) {
|
||||
GST_ERROR_OBJECT (element, "No paste vmethod implemented");
|
||||
|
||||
gst_object_unref (copied_from);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
@ -2800,13 +2801,15 @@ ges_timeline_paste_element (GESTimeline * timeline,
|
|||
if (layer_priority != -1) {
|
||||
GST_WARNING_OBJECT (timeline,
|
||||
"Only -1 value for layer priority is supported");
|
||||
gst_object_unref (copied_from);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
res = element_class->paste (element, copied_from, position);
|
||||
|
||||
g_clear_object (&copied_from);
|
||||
gst_object_unref (copied_from);
|
||||
|
||||
return g_object_ref (res);
|
||||
return res ? g_object_ref (res) : res;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in a new issue