mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-09 00:45:56 +00:00
layer: fix ownership when failing to add clip
If a clip is already part of a layer, then adding it to another layer should fail. Previously, in this case, `ges_layer_add_clip` was adding a reference to the clip instead, without subsequently giving up ownership. This meant that the clip would be left with an unowned reference. This has now been corrected by also calling `unref` after the `ref_sink`. Note that, since `clip` is already part of `current_layer`, it should already be non-floating, so the `ref_sink`-`unref` should do nothing overall. But we keep both to make the ownership (transfer floating/none) explicit.
This commit is contained in:
parent
a03afa5476
commit
1332ed674a
1 changed files with 1 additions and 2 deletions
|
@ -631,9 +631,8 @@ ges_layer_add_clip (GESLayer * layer, GESClip * clip)
|
|||
current_layer = ges_clip_get_layer (clip);
|
||||
if (G_UNLIKELY (current_layer)) {
|
||||
GST_WARNING ("Clip %p already belongs to another layer", clip);
|
||||
/* FIXME: why are we reffing the clip if it belongs to another
|
||||
* layer? */
|
||||
gst_object_ref_sink (clip);
|
||||
gst_object_unref (clip);
|
||||
gst_object_unref (current_layer);
|
||||
|
||||
return FALSE;
|
||||
|
|
Loading…
Reference in a new issue